Version 4.0
- 8 -
ADDRESS
FUNCTION (Function code + 80H)
ERROR CODE
CRC CHECK
8 BITS
8 BITS
8 BITS
16 BITS
Error Code
Contents
Description
01
Illegal function
The function code received is not an allowable
action for the slave.
02
Illegal data address
The data address received is not an allowable
address for the slave.
03
Illegal data value
A value contained in the data field is not an
allowable value for the slave.
5.4 Function Code
The listing below shows the function codes supported by MV-D94 controllers.
Function code
Code
Function
Object
03
Read-out
Holding Register
04
Read-out
Input Register
06
Write-in
Holding Register
5.5 Calculation of Error Check Code (CRC-16)
CRC-16 is the 2-bytes (16-bits) error check code. From the top of the message
(address) to the end of the data field are calculated.
The slave station calculates the CRC of the received message, and does not respond if
the calculated CRC is different from the contents of the received CRC code.
A procedure for generating a CRC is:
1. Load a 16-bits register with FFFF hex (all 1
'
s). Call this the CRC register.
2. Exclusive OR the first 8-bit byte of the message with the low-order byte of the
16-bit CRC registers, putting the result in the CRC register.
3. If the LSB is 0: Shift the CRC register one bit to the right (toward the LSB),
Zero-filling the MSB.
If the LSB is 1: Shift the CRC register one bit to the right (toward the LSB),
Zero-filling the MSB. Exclusive OR the CRC registers with the polynomial value
A001 hex.