Floor 03 · Workshop

Modbus toolkit

CRC16 for RTU frames and float decoding in every byte order.

Workshop

CRC16 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

OrderFloat32Int32UInt32
ABCD12.5600010953005471095300547
CDAB-4.950302e+32-1717531444123214152
BADC198415.812122695571212269557
DCBA-490.5645-10073353593287631937

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.