beautypg.com

Modbus point addressing, Important notes, Address format – Contemporary Control Systems BASview User Manual

Page 51

background image

TD110500-0MC

51

Modbus Point Addressing

Modbus point addressing is fairly simple for the majority of Modbus points, but can get complicated
because of inconsistencies in the way some devices implement the standard.

Important notes:
The documentation of some Modbus devices will list holding registers as 40,005 rather than just 5. If the
address given is greater than 40,000, you will usually need to subtract 40,000 from the number and use
HREG5 instead of HREG40005. The same is true for input registers being listed as 30,000.

There also seems to be differences in the way some devices address their points starting at zero and
others starting at one. Some devices will document a point as coil 1 (OUT1), but it will actually be coil 0
(OUT0). If in doubt, configure one point that should return a known value. If you do not get the correct
value, try to raise or lower the point number by one. If you then get a correct value, all of the point
addresses will need to be adjusted by the same amount.

Inputs and input registers are read-only.

Address Format
A valid address must have at least a point type and a point number:

OUT3

— Output #3 (Coil 3)

IN14

— Input #14

HREG205

— Holding register #205

IREG12

— Input register #12

For non-standard points, the following extra parameters may be specified for holding and input registers:

HREGxxx, FirstBit, NumberOfBits, DataType

(Bits are numbered from right to left. Bit 0 is the right-most, or least-significant bit.)

Examples:

HREG142,0,8,I (I = the letter i)

This example will read the 16-bit value from holding register 142, then take the 8 bits starting at bit 0 and convert
it to an integer (whole number) value.

HREG64,4,3,I (I = the letter i)

This example will read the 16-bit value from holding register 64, then take the 3 bits starting at bit 4 and convert
it to an integer (whole number) value. Note that the value (binary 0xxx0000) is automatically right-shifted so that
the value will always be between 0 and 7 (00000xxx). If the user changes the point value, it is automatically left-
shifted back in to the proper position before being written to the device.

IREG41,0,32,F

This example will read two 16-bit values starting at input register 41, then take all 32 bits and convert it to a floating
point number

The valid data types are:

B = Boolean (true/false)
I = Integer
F = Floating point
R = "Reverse" floating point (required for some devices)
S = String
O = Object
D = Date/Time