Signed 16-bit integer
Signed 16-bit integers use 1 register per value. On the data logger, declare your destination
variable as type Long. A Long is a 32-bit signed integer that contains the value received . Select
the appropriate ModbusOption to avoid post-processing.
Signed 32-bit integer
Signed 32-bit integers require two registers per value. This data type corresponds to the native
Long variable type in Campbell data loggers. Declare your variables as type Long before using
them as the Variable parameter in ModbusClient(). Select the appropriate ModbusOption
to avoid post-processing.
Unsigned 32-bit integer
Unsigned 32-bit integers require two registers per value. Declare your variables as type Long
before using them as the Variable parameter in ModbusClient(). The Long data type is a
signed integer, and does not have a range equal to that of an unsigned integer. If the integer
value exceeds 2,147,483,647 it will display incorrectly as a negative number. If the value does not
exceed that number, there are no issues with a variable of type Long holding it.
32-Bit floating point
32-bit floating point values use 2 registers each. This is the default FLOAT data type in Campbell
Scientific data loggers. Select the appropriate ModbusOption to avoid post-processing.
19.2.8 Modbus tips and troubleshooting
Most of the difficulties with Modbus communications arise from deviations from the standards,
which are not enforced within Modbus. Whether you are connecting via Modbus to a solar
inverter, power meter, or flow meter, the information provided here can help you overcome the
challenges, and successfully gather data into a Campbell data logger. Further information on
Modbus can be found at:
www.simplyModbus.ca/FAQ.htm
l
www.Modbus.org/tech.php
l
www.lammertbies.nl/comm/info/modbus.html
l
19. Communications protocols 118