Data message format
3886_en_A
PHOENIX CONTACT
41
4
Data message format
4.1
Input and output submodule data format
4.1.1
Data format of an input submodule.
The sequence number range is from 0 to 65535 (16#FFFF). Once the sequence number
reaches 65535, it restarts at 0. The data length range is from 0 to 220, indicating the number
of bytes received. The actual data starts from offset 4.
When a packet larger than the configured input submodule is received, the packet is
truncated by default. However, the length field always contains the original packet size. For
example, a serial port is configured with a 32-byte input submodule. A packet of 40 bytes is
received. The IO controller will receive the first 32 bytes input data and the length field will
be 40. A length field larger than the size of input submodule indicates that the data has been
truncated.
4.1.2
Data format of an output submodule.
The output data has the same format as the input data of an input submodule. The
GW PN/ASCII... transmits the number of output data indicated by the length field when the
sequence number field changes. The GW PN/ASCII... only transmits the output data once.
No further data is transmitted until the sequence number is changed again.
Table 4-1
Data type definitions
Data type
Data type definition
Byte
An integer 0 … 255 (8 bit). for example,
ASCII strings are a series of bytes.
Word
Unsigned integer (16 bit)
Dword
Unsigned integer (32 bit)
Table 4-2
Input submodule format
Byte offset
Input submodule data type
Description
0-1
Word
Sequence number (big endian)
2-3
Word
Data length (big endian)
4..N
Array of byte
Data array (maximum 220 bytes)
Table 4-3
Output submodule format
Byte offset
Output submodule data type
Description
0-1
Word
Sequence number (big endian)
2-3
Word
Data length (big endian)
4..N
Array of byte
Data array (maximum 220 bytes)