105BCommunication processor
12.3 Point-to-Point (PtP) communication
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
565
12.3.5.2
Programming the STEP 7 program
The example program uses a global data block for the communication buffer, a RCV_PTP
instruction (Page 544) to receive data from the terminal emulator, and a SEND_PTP
instruction (Page 541) to echo the buffer back to the terminal emulator. To program the
example, add the data block configuration and program OB1 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.