Case 5: RS485: No bias (external bias)
● Mode of operation: RS485
● Receive line initial state: No bias (external bias required)
13.3.7.3
Programming the STEP 7 program
The example program uses a global data block for the communication buffer, a RCV_PTP
instruction (Page 1229) to receive data from the terminal emulator, and a SEND_PTP
instruction (Page 1226) to echo the buffer back to the terminal emulator. To program the
example, add the data block configuration and Main program block OB 1 as described
below.
Global data block "Comm_Buffer": Create a global data block (DB) and name it
"Comm_Buffer". Create one value in the data block called "buffer" with a data type of "array
[0 .. 99] of byte".
Network 1: Enable the RCV_PTP instruction whenever SEND_PTP is not active. Tag_8 at
MW20.0 indicates when sending is complete in Network 4, and when the communication
module is thus ready to receive a message.
Network 2: Use the NDR value (Tag_1 at M0.0) set by the RCV_PTP instruction to make a
copy of the number of bytes received and to set a flag (Tag_8 at M20.0) to trigger the
SEND_PTP instruction.
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
Communication processor and Modbus TCP
13.3 Point-to-point (PtP) communication
1143