IDEC MicroSmart User Manual

Page 300

Advertising
background image

17: U

SER

C

OMMUNICATION

I

NSTRUCTIONS

17-22

« FC4A M

ICRO

S

MART

U

SER

S

M

ANUAL

»

Conversion Type

The BCC calculation result can be converted or not according to the designated conversion type as described below:

Example: BCC calculation result is 0041h.

(1) Binary to ASCII conversion

(2) No conversion

BCC Digits (Bytes)

The quantity of digits (bytes) of the BCC code can be selected from 1 or 2.

Example:

Comparing BCC Codes

The

MicroSmart

compares the BCC calculation result with the BCC code in the received incoming data to check for any

error in the incoming communication due to external noises or other causes. If a disparity is found in the comparison, an
error code is stored in the data register designated as receive status in the RXD instruction. For user communication error
code, see page 17-27.

Example 1: BCC is calculated for the first byte through the sixth byte using the XOR format, converted in binary to
ASCII, and compared with the BCC code appended to the seventh and eighth bytes of the incoming data.

0041h

Binar y to ASCII conversion

“4”

(34h)

“1”

(31h)

2 digits

Note: On WindLDR, Modbus ASCII is
defaulted to binar y to ASCII conversion.

0041h

No conversion

NUL

(00h)

“A”

(41h)

2 digits

Note: On WindLDR, Modbus RTU is
defaulted to no conversion.

(1) BCC digits = 2

“4”

(34h)

“1”

(31h)

“4”

(34h)

“1”

(31h)

(2) BCC digits = 1

“4”

(34h)

“1”

(31h)

“1”

(31h)

Lower digit

Note: On WindLDR, Modbus ASCII and
Modbus RTU are defaulted to 2 digits.

“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 = 07h

“0”

(30h)

“7”

(37h)

BCC Calculation Result

Binar y to ASCII Conversion

Comparison result is true to indicate
that data is received correctly.

Advertising