Data in Modbus devices can exist in a wide variety of ways. In a NiagaraAX Modbus integration, data is brought into Niagara's common object model in a manner that simplifies the sharing of values. See the following subsections for details:
By definition, data represented by coils and inputs is “status”, which in Modbus nomenclature means “boolean” (On/Off). In Niagara, this equates to two-state, meaning Active or Inactive (true or false).
As far as input registers and holding registers are concerned, however, the Modbus protocol does not dictate how data is formatted (data type used, numerical encoding). A Modbus device vendor can use whatever data types are needed and can be accomplished with one or more consecutive 16-bit registers.
The device vendor should document the data type used for each input register and holding register—and it is important to configure
Niagara Modbus proxy points accordingly. When dealing with 32-bit values such as long or float values (see Numerical data types below), this includes the “byte-order scheme” for the two consecutive registers, as processed in the device.
Perhaps the most popular data type for a register is “integer,” using a single register. This is the Niagara “Data Type” for an unsigned, 16-bit integer value, and is the default data type for many newly-created Modbus proxy points. The value range possible in an integer value is 0 to 65,535. Note that in some systems (or devices), the term word is synonymous, that is, meaning an unsigned, 16-bit integer value.
The following numerical data types are supported by Niagara proxy points for Modbus input registers and holding registers:
Integer — Unsigned 16-bit integer, data range 0 to 65,535. Same as “word”.
Float— (floating point), 32-bit single precision, sometimes called “real”. Very small and large numbers are possible. Requires two consecutive registers[2] in the Modbus device. In addition, there are two different byte-order schemes for float values (3-2-1-0 or 1-0-3-2).
Long — Signed 32-bit integer, data range -2,147,483,648 to 2,147,483,647. Also requires two consecutive registers, and the same byte-order scheme information (as for “float” data).
Signed Integer — Signed 16-bit integer, data range -32,768 to 32,767. Sometimes called “short”.
For any Modbus proxy NumericPoint or NumericWritable, you specify this in the “Data Type” property of its Modbus proxy extension.
Note that the “byte order” scheme for two-register numeric values (float and long) can be set at the device level (if necessary), or set globally at the network level. See Device-to-device differences for related details.
In addition to these numeric formats, sometimes a holding register or input register is used by a device to pack a number of boolean statuses (On/Off states), with each status mapped to a bit. NiagaraAX Modbus provides special “Register Bit” proxy point extensions for boolean control points to read and write to such registers, accessing each bit independently per proxy point.
Also (although not common), a Modbus device may use a number of consecutive holding registers to hold a string of alphanumeric (ASCII encoded) characters. The Modbus integration provides a “Modbus String” proxy point extension for String control points to read such character strings.
With the exception of the String control point with the “Modbus String” proxy point extension, Modbus proxy points represent all data on their inputs and outputs using these Niagara data types:
Boolean — BooleanPoint and BooleanWritable. Two-state data represented by coils and inputs. Less frequently, boolean data is “bitmapped” into input registers or holding registers. Note that all Modbus boolean proxy points provide facets that you can individually edit to match the vendor's documented state descriptions, such as “On” and “Off”, or “enable” and “disable”.
Numeric — NumericPoint and NumericWritable. Numerical data in holding registers or input registers, whether a Modbus Float proxy point's selected Data Type is integer, long, float, or signed integer (see Numerical data types). Note that all Modbus numeric proxy points provide facets that you can individually edit for minimum/maximum values, precision, and data units.
Enum — (Modbus 3.5.26 or higher, or AX-3.6 or later) EnumPoint and EnumWritable. Enumerated data in holding registers or input registers, using the integer (ordinal) value resulting from some range of consecutive bits, specified by a starting bit and number of bits. See Example.
Note that Modbus NumericWritable proxy points that write values to holding registers provide rounding (and possibly clamping) of the input value before any write. This depends on the proxy point’s selected Data Type, as follows:
Integer type — Input values are rounded up or down to the nearest whole number. Range is from 0 to 65,535; input values outside the range are clamped to these limits.
Long type — Input values are rounded up or down to the nearest whole number. The range (-2,147,483,648 to 2,147,483,647) matches the Niagara value range.
Signed Integer type — Input values are rounded up or down to the nearest whole number. Range is from -32,768 to 32,767; input values outside this range are clamped to these limits.
Float type — No rounding—any input value is written directly as is.
[2] Proxy points automatically allocate 2 consecutive registers for each data item whenever you specify a float or long data type. Keep this in mind when specifying “number of points” within any range of Modbus registers.
Copyright © 2000-2016 Tridium Inc. All rights reserved.