Modbus Information Storage; Registers - Campbell CR300 Series Product Manual

Compact datalogger
Hide thumbs Also See for CR300 Series:
Table of Contents

Advertisement

19.2.7 Modbus information storage

With the Modbus protocol, most of the data values you want to transmit or receive are stored in
registers. Information is stored in the server device in four different entities. Two store on/off
discrete values (coils) and two store numerical values (registers). The four entities include:
 
Coils – 1-bit registers, used to control discrete outputs (including Boolean values),
l
read/write.
 
Discrete Input – 1-bit registers, used as inputs, read only.
l
 
Input Registers – 16-bit registers, used as inputs, read only.
l
 
Holding Registers – 16-bit registers; used for inputs, output, configuration data, or any
l
requirement for "holding" data; read/write.
See the CRBasic Editor help for detailed instruction information and program examples:
https://help.campbellsci.com/crbasic/cr300/

19.2.7.1 Registers

In a 16-bit memory location, a 4-byte value takes up two registers. The Modbus protocol always
refers to data registers with a starting address number, and a length to indicate how many
registers to transfer.
Campbell Scientific uses 1-based numbering (a common convention for numbering registers in
ModbusClient()
equipment) in the
location is referred to as register number 1. Some equipment uses 0-based numbering (check the
equipment documentation). With 0-based numbering, the first register is referred to as 0.
Reading register numbers can be complicated by the fact that register numbers are often written
with an offset added. Input registers are written with an offset of 30000. So, the first input register
is written as 30001, with 1-based numbering. Holding registers are numbered with an offset of
40000. You must remove the offset before writing the number as the Start parameter of
ModbusClient().
There are rare instances when equipment is designed with the registers mapped including the
offset. That means 40001 in the documentation is really register number 40001. Those are rare
instances, and the equipment is deviating from standards. If 1 or 2 don't work for the Start
parameter, try 40001 and 40002.
.
instruction. With 1-based numbering, the first data
19. Communications protocols     116

Advertisement

Table of Contents
loading

Table of Contents