sinee — 11.3.6CRC check

User Manual of EM730 Series Inverter 11.3.5 Definition of frame data length The PDU part of the RTU frame of the MODBUS message is able to read/write 1-16 registers. For different function codes, the actual length of the RTU frame varies, as detailed in Table 12-32. Table 12- 32 Correspondence between RTU Frame Length and Function Code [4]: N r ≤16, indicating the number of requests to read registers; [5]: N w ≤16, indicating the number of requests to write registers. [6]: N w +N r ≤16; 11.3.6 CRC check The low byte of CRC check is in front of the high byte. The transmitter first calculates the CRC value, which is included in the sent message.

Upon receiving the message, the receiver will recalculate the CRC value and compare the calculated value with the received CRC value. If the two values are not equal, it means that there is an error in the sending process. Calculation process of CRC check: (1) Define a CRC register and assign an initial value, FFFFH. (2) Perform the XOR calculation with the first byte of the transmitted message and the value of the CRC register, and store the result in the CRC register. Starting from the address code, the start bit and stop bit are not involved in calculation. (3) Extract and check the LSB (the least significant bit of the CRC register).

(4) If the LSB is 1, each bit of the CRC register is shifted to the right by one bit, and the most significant bit is supplemented by 0. Perform the XOR calculation of the value of the CRC register and A001H, and store the result in the CRC register. 384 7509H~ 75FFH Reserved Others Reserved Function code (0x) RTU frame length (bytes) Maximum length (Byte) Request Normal response Exception response 03 8 5+2N[4] r 5 37 41(06) 8 8 5 8 08 8 8 5 8 42(10) 9+2N [5] w 8 5 41