105BCommunication processor
12.3 Point-to-Point (PtP) communication
S7-1200 Programmable controller
562
System Manual, 11/2011, A5E02486680-05
3.
When the SEND_PTP instruction indicates that the transmission is complete, the user
code can prepare to receive the response.
4.
The RCV_PTP instruction is executed repeatedly to check for a response. When the CM
or CB has collected a response message, the RCV_PTP instruction copies the response
to the CPU and indicates that new data has been received.
5.
The user program can process the response.
6.
Go to step 1 and repeat the cycle.
Polling architecture: slave
The typical sequence for a slave is as follows:
1.
The user program executes the RCV_PTP instruction every scan.
2.
When the CM or CB has received a request, the RCV_PTP instruction indicates that new
data is ready and the request is copied into the CPU.
3.
The user program services the request and generates a response.
4.
Use a SEND_PTP instruction to send the response back to the master.
5.
Repeatedly execute SEND_PTP to be sure the transmit occurs.
6.
Go to step 1 and repeat the cycle.
The slave must be responsible for calling RCV_PTP frequently enough to receive a
transmission from the master before the master times out while waiting for a response. To
accomplish this task, the user program can call RCV_PTP from a cyclic OB, where the cycle
time is sufficient to receive a transmission from the master before the timeout period expires.
If you set the cycle time for the OB to provide for two executions within the timeout period of
the master, the user program can receive transmissions without missing any.
12.3.5
Example: Point-to-Point communication
In this example, an S7-1200 CPU communicates to a PC with a terminal emulator through a
CM 1241 RS232 module. The point-to-point configuration and STEP 7 program in this
example illustrate how the CPU can receive a message from the PC and echo the message
back to the PC.
. . .