Point-to-Point (PtP) communications
8.6 Programming the PtP communications
Example 2: Consider another message structured according to the following protocol:
SD1
xx
Configure the receive message length parameters for this message as follows:
● n = 3 (The message length starts at byte 3.)
● Length size = 1 (The message length is defined in one byte.)
● Length m = 3 (There are three characters following the length specifier that are not
counted in the length. In the protocol of this example, the characters SD2, FCS, and ED
are not counted in the length count. The other six characters are counted in the length
count; therefore the total number of characters following the length specifier is nine.)
In this example, the characters from 5 to 10 inclusive are the characters counted by Len (n).
8.6
Programming the PtP communications
STEP 7 Basic provides extended instructions that enable the user program to perform Point-
to-Point communications with a protocol designed and specified in the user program. These
instructions can be considered in two categories:
● Configuration instructions
● Communication instructions
Configuration instructions
Before your user program can engage in PtP communication, you must configure the
communication interface port and the parameters for sending data and receiving data.
You can perform the port configuration and message configuration for
each communication module through the device configuration or
through these instructions in your user program:
Communication instructions
The PtP communication instructions enable the user program to send messages to and
receive messages from the communication modules. For information transferring data with
these instructions, see the section on data consistency (Page 86).
All of the PtP functions operate asynchronously. The user program can use a polling
architecture to determine the status of transmissions and receptions. SEND_PTP and
RCV_PTP can execute concurrently. The communication modules buffer the transmit and
receive messages as necessary up to a maximum buffer size of 1024 bytes.
246
Len
Len
SD2
(n)
(n)
1
2
3
0x06
0x06
Characters 5 to 10 counted by length
DA
SA
4
5
6
xx
xx
xx
FA
Data unit=3 bytes
7
8
9
xx
xx
xx
S7-1200 Programmable controller
System Manual, 11/2009, A5E02486680-02
FCS
ED
10
11
12
xx
xx
xx
PORT_CFG
SEND_CFG
RCV_CFG