Example 1: Consider a message structured according to the following protocol:
STX
Len
(n)
ADR
1
2
3
STX
0x0C
xx
Configure the receive message length parameters for this message as follows:
● n = 2 (The message length starts with byte 2.)
● Length size = 1 (The message length is defined in one byte.)
● Length m = 0 (There are no additional characters following the length specifier that are
In this example, the characters from 3 to 14 inclusive are the characters counted by Len (n).
Example 2: Consider another message structured according to the following protocol:
SD1
Len (n)
Len (n)
1
2
xx
0x06
0x06
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
In this example, the characters from 5 to 10 inclusive are the characters counted by Len (n).
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
PKE
4
5
6
xxxx
not counted in the length count. Twelve characters follow the length specifier.)
SD2
DA
3
4
5
xx
xx
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.)
Characters 3 to 14 counted by the length
INDEX
PWD
7
8
xxxx
xxxx
Characters 5 to 10 counted by length
SA
FA
6
7
xx
xx
Communication processor and Modbus TCP
12.3 Point-to-point (PtP) communication
STW
9
10
11
xxxx
Data unit=3 bytes
8
9
10
xx
xx
xx
HSW
BCC
12
13
14
xxxx
xx
FCS
ED
11
12
xx
xx
683