Programming The Step 7 Program - Siemens S7-1200 System Manual

Hide thumbs Also See for S7-1200:
Table of Contents
Communication processor and Modbus TCP
12.3 Point-to-point (PtP) communication
Case 5: RS485: No bias (external bias)
● Mode of operation: RS485
● Receive line initial state: No bias (external bias required)
12.3.5.3

Programming the STEP 7 program

The example program uses a global data block for the communication buffer, a RCV_PTP
instruction (Page 697) to receive data from the terminal emulator, and a SEND_PTP
instruction (Page 694) 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.
710
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
Table of Contents
loading

Table of Contents