2 DATA COMMUNICATION USING PREDEFINED PROTOCOL
2.3 Packet
37
2
Length
Use this element when an element indicating the data length is included in a packet.
• When sending: Calculates the data length of a specified range, and adds the result to a send packet.
• When receiving: Verifies the data (value) corresponds to the length in the received data as the data length of a specified
range.
• Only one length can be used in a packet.
• When there is no element other than a length, an element error occurs.
• When the number of digits of calculation result is greater than that specified in "Data Length", digits greater
than the specified digit are omitted (ignored).
Example) When "2 bytes" is specified in "Data Length" and the calculation result is "123 bytes", the data
length is considered as "23".
• When any of a Non-conversion variable (Variable length), Conversion variable (Variable number of data),
Conversion variable (Fixed number of data/Variable number of digits
*1
), and Non-verified reception
(Variable number of characters) is placed behind a Length and they are not included in the calculating range
of the Length, place any of the following data immediate after the Non-conversion variable (Variable length),
Conversion variable (Variable length) or Non-verified reception.
Static Data
Terminator
Check code + Static Data
Check code + Terminator
• When "Code Type" is "ASCII Hexadecimal", a corresponding packet is regarded as a mismatch packet if a
string except for '0' to '9', 'A' to 'F', and 'a' to 'f' is received.
• When "Code Type" is "ASCII Decimal", a corresponding packet is regarded as a mismatch packet if a string
except for '0' to '9' is received.
*1 Excluding a case where "Number of Send Data" is '1' and "Delimiter" is not 'No delimiter'.
Item Description Remarks
Element Name Set a name of the element.
Code Type Select a format of the data length.
ASCII Hexadecimal/ASCII Decimal/HEX
Data Length Select the data length on the line.
The range is 1 to 4.
Data Flow Forward Direction
(Upper Byte → Lower Byte)
• When sending: Sends a calculated length from the upper byte.
• When receiving: Receives data from the upper byte.
Cannot be set when
"Data Length" is 1 byte.
Reverse Direction
(Lower Byte → Upper Byte)
• When sending: Sends a calculated length from the lower byte.
• When receiving: Receives data from the lower byte.
Byte Swap
(by Word)
• When sending: Sends a calculated length swapping the upper byte and
lower byte by word.
• When receiving: Receives data swapping the upper byte and lower byte by
word.
Calculating
Range
Start Select the start packet element numbers for the calculating range.
The range is 1 to 32.
End Select the last packet element numbers for the calculating range.
The range is 1 to 32.