10: U
SER
C
OMMUNICATION
I
NSTRUCTIONS
FC5A M
ICRO
S
MART
U
SER
’
S
M
ANUAL
FC9Y-B1268
10-27
Example 2:
BCC is calculated for the first byte through the sixth byte using the ADD format, converted in binary to ASCII,
and compared with the BCC code appended to the seventh and eighth bytes of the incoming data.
“1”
(31h)
“2”
(32h)
BCC Calculation Range
“3”
(33h)
“4”
(34h)
Incoming Data
“5”
(35h)
“6”
(36h)
“0”
(30h)
“7”
(37h)
BCC
31h + 32h + 33h + 34h + 35h + 36h = 135h
“3”
(33h)
“5”
(35h)
BCC Calculation Result
Binary to ASCII Conversion
Comparison result is false.
Error code 9 is stored in the receive status
data register.
Receive Completion Output
Designate an output, Q0 through Q627, or internal relay, M0 through M2557, as a device for the receive completion out-
put.
When the start input for a RXD instruction is turned on, preparation for receiving data is initiated, followed by data con-
version and storage. When a sequence of all data receive operation is complete, the designated output or internal relay is
turned on.
Conditions for Completion of Receiving Data
After starting to receive data, the RXD instruction can be completed in three ways depending on the designation of end delimiter and
delimiter in the receive format.
End Delimiter
Delimiter
Conditions for Completion of Receiving Data
With
With or Without
When a specified byte count of data (digits
repeat) has been received or when an end
delimiter is received. When a BCC exists immediately after the end delimiter, the BCC is
received before ending data receiving.
Without
With
After the last constant (including delimiter) designated in the RXD instruction has been
received, data receiving is completed when the subsequent byte count of data has been
received.
Without
Without
When a specified byte count of data (digits
repeat) has been received.
Note:
Whenever a receive timeout has occurred, data receiving is stopped arbitrarily.
Data receiving is completed when one of the above three conditions is met. To abort a RXD instruction, use the special internal relay
for user communication receive instruction cancel flag. See page 10-28.
Example:
A RXD instruction does not have an end delimiter and has a delimiter programmed in the receive format for
data registers.
Receive Format
DR1
FFh
BCC
1 byte
4 bytes max. + delimiter 1 byte
2 bytes max.
DR2
Delimiter:
FFh
Conversion:
ASCII to BIN
Digits:
4
Repeat:
1
Delimiter:
—
Conversion:
None
Digits:
2
Repeat:
1
After delimiter FFh has been received, data
receiving is completed when subsequent 3
bytes are received.
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]