EasyManua.ls Logo

Campbell CR6 - 32-Bit Floating Point; Signed 32-Bit Integer; Unsigned 32-Bit Integer; Modbus Tips and Troubleshooting

Campbell CR6
285 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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 ModbusMaster(). 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 ModbusMaster(). 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.
7.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:
l www.simplyModbus.ca/FAQ.htm
l www.Modbus.org/tech.php
l www.lammertbies.nl/comm/info/modbus.html
7.2.8.1 Error codes
Modbus defines several error codes, which are reported back to a master from a slave.
ModbusMaster() displays these codes as a negative number. A positive result code indicates
no response was received.
Result code -01: illegal function
The illegal function error is reported back by a Modbus slave when either it does not support the
function at all, or does not support that function code on the requested registers. Different
devices support different functions (consult the device documentation). If the function code is
supported, make sure you are not trying to write to a register labeled as read-only. It is common
7. Communications protocols 100

Table of Contents

Related product manuals