Floor 03 · Workshop
Modbus toolkit
CRC16 for RTU frames and float decoding in every byte order.
WorkshopCRC16 for an RTU frame
- CRC (low byte first)
- C5 CD
- Full frame
- 01 03 00 00 00 0A C5 CD
- Function
- 3 · Read Holding Registers
Encode a value to registers
ABCD4148 F5C3
CDABF5C3 4148
BADC4841 C3F5
DCBAC3F5 4841
Decode two registers to Float32 / Int32
| Order | Float32 | Int32 | UInt32 |
|---|---|---|---|
| ABCD | 12.56000 | 1095300547 | 1095300547 |
| CDAB | -4.950302e+32 | -171753144 | 4123214152 |
| BADC | 198415.8 | 1212269557 | 1212269557 |
| DCBA | -490.5645 | -1007335359 | 3287631937 |
Modbus RTU CRC16: polynomial 0xA001, initial value 0xFFFF, low byte sent first.
A Float32 spans two registers and every vendor orders them differently: ABCD (big-endian), CDAB (word swap, very common), BADC, DCBA. If a reading looks wrong, compare all four orders here.