Skip to main content

Modbus

Supported datatypes

C (Coil)I (Input)IR (Input register)HR (Holding register)
Bitxxxx
Short (1 reg)xx
UShort (1 reg)xx
Int (2 reg)xx
UInt (2 reg)xx
Long (4 reg)xx
ULong (4 reg)xx
Float (2 reg)xx
Double (4 reg)xx
String (variable length)xx

Factor

If the value needs to be divided by a number (for example because the raw value is an integer, but represents a decimal number with 2 decimal places), you can add a factor:

`HR,USHORT40,FACTOR:100' will take the unsigned short at position 40, and divide it by 100. The value 12345 is read as 123.45

Examples

Address starts at 0 for each register type => fe. integer located in holding reg 400001 = HR,INT0

Holding registers

HR,BIT10.5 => reg 10, bit 5 (mind byte swapping property)

HR,DOUBLE20

HR,STRING30.10 => length of this string is 10 regs

HR,SHORT40

HR,INT45

HR,LONG50

HR,FLOAT50

Input register

IR,BIT10.5 => reg 10, bit 5 (mind byte swapping property)

IR,DOUBLE20

IR,STRING30.10 => length of this string is 10 regs

IR,SHORT40

IR,INT45

IR,LONG50

IR,FLOAT50

Coil

C,BIT10

Input (digital)

I,BIT10