10: U
SER
C
OMMUNICATION
I
NSTRUCTIONS
FC5A M
ICRO
S
MART
U
SER
’
S
M
ANUAL
FC9Y-B1268
10-23
(3) When a RXD instruction with end delimiter ETX (03h) and one-byte BCC is executed
****h
D100
When D100 is designated
ETX
(03h)
“1”
(31h)
End delimiter
“2”
(32h)
BCC
Code
Incoming data
****h
D100+n
****h
D101
The incoming data is divided, converted, and stored to data registers according to the receive format.
The end delimiter and BCC code are not stored to data registers.
After receiving the end delimiter, the MicroSmart receives only the one-byte BCC code.
as the first data register
End of receiving data
Constant for Verification (System program 200 or higher)
When using CPU modules with system program version 200 or higher, constants excluding start and end delimiters can be
configured in the receive format to verify the incoming data with the constants, which are either characters or hexadeci-
mal values. Constants for the verification can be configured as many as required. The verification result is stored in the
receive status of the RXD instruction.
Note:
Constants other than start or end delimiters cannot be configured in the receive format for the CPU modules with the system
program earlier than 200. If configured, RXD instructions do not complete receiving the incoming data normally.
Example: Programming Constant for Verification
The following example shows the advantage of using constant for verification. The incoming data contains a constant
value “1” in the middle, and that constant value needs to be verified to see whether the incoming data is valid.
• Using Data Register
The incoming data including the constant value needs to be stored in data registers. When the RXD instruction completes
receiving the incoming data, the receive status contains 64, meaning the RXD instruction has completed without errors,
even if the constant value is not an expected value. Extra ladder programming is needed to see whether the constant
value in the incoming data is correct or not.
STX
(02h)
(3xh)
Start
Delimiter
(3xh)
“1“
(31h)
(3xh)
(3xh)
CR
(13h)
Stored to D1 through D5
End
Delimiter
• Using Constant for Verification (system program version 200 or higher)
A constant to verify the constant value in the incoming data is designated in the receive format. If the constant value is
not an expected value when the RXD instruction completes receiving the incoming data, the receive status contains 74,
meaning the RXD instruction has completed but user communication error code 5 occurred. No extra ladder program-
ming is needed to see whether the constant value in the received data is correct or not.
STX
(02h)
(3xh)
Start
Delimiter
(3xh)
“1“
(31h)
(3xh)
(3xh)
CR
(13h)
Stored to D3 and D4
End
Delimiter
Constant
Stored to D1 and D2
Note:
When configuring constants, which are either characters or hexadecimal values, in the receive format, and the incoming data do
not match the constants in the receive format, then a user communication error code is stored in the receive status. The error code
contained in the receive status depends on whether the constants are used as a start delimiter or as constants for verification. If used
as a start delimiter, user communication error code 7 is stored in the receive status, and the RXD instruction keeps waiting for valid
incoming data. On the other hand, if used as constants for verification, the receive status contains 74, and the RXD instruction finishes
the execution. To repeat receiving incoming communication, turn on the input for the RXD instruction.
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]