Appendix B
-
147
-
The frame format is described in the following table.
Frame header (START) Greater than the 3.5-byte transmission idle time
Slave address (ADR) Communication address: 1 to 247; 0: Broadcast address
Command code (CMD) 03: Read slave parameters; 06: Write slave parameters
Function code address
(H)
It is the internal parameter address of the AC drive, expressed in hexadecimal format. The
parameters include functional parameters and non-functional parameters (running status and
running command).
During transmission, low-order bytes follow the high-order bytes.
Function code address
(L)
Number of function
codes (H)
It is the number of function codes read by this frame. If it is 1, it indicates that one function
code is read. During transmission, low-order bytes follow the high-order bytes.
In the present protocol, only one function code is read once, and this eld is unavailable.
Number of function
codes (L)
Data (H)
It is the response data or data to be written. During transmission, low-order bytes follow the
high-order bytes.
Data (L)
CRC CHK low bytes Detection value: CRC16 verication value During transmission, low-order bytes follow the
high-order bytes.
For calculation method, refer to CRC Check.
CRC CHK high bytes
END It is 3.5-byte transmission time.
CRC Check
In Modbus-RTU mode, a message includes a CRC-based error-check eld. The CRC eld checks content of
the entire message. The CRC eld is two bytes, containing a 16-bit binary value. The CRC eld is calculated
by the transmitting device, and then added to message. The receiving device recalculates a CRC value after
receiving the message, and compares the calculated value with the CRC value in the received CRC field.
The CRC is rst stored to 0xFFFF. Then a procedure is invoked to process the successive 8-bit byte in the mes-
sage and the value in the register. Only the eight bits in each character are used for the CRC. The start bit, stop
bit and the parity bit do not apply to the CRC. During generation of the CRC, each eight-bit character is in exclu-
sive-OR (XOR) with the content in the register. Then the result is shifted in the direction of the least signicant
bit (LSB), with a zero lled into the most signicant bit (MSB) position. The LSB is extracted and examined. If
the LSB was a 1, the register then performs XOR with a preset value. If the LSB was a 0, no XOR is performed.
This process is repeated until eight shifts have been performed. After the last (eighth) shift, the next eight-
bit byte is in XOR with the register's current value, and the process repeats for eight more shifts as described
above. The nal value of the register, after all the bytes of the message have been applied, is the CRC value.
The CRC is added to the message from the low-order byte followed by the high-order byte. The CRC simple
function is as follows: