brownfieldDevices.modbus
Use a Modbus connection to read registers and coils of a Modbus TCP device. You declare points: each point has a name, an address and a type. A mapping entry reads a point with modbus: <connection>:<point>. With expose:, the gateway also publishes the device as an Object that has one variable for each point.
Example
brownfieldDevices:
modbus:
- name: MB1
type: TCP
address: 192.168.1.40
port: 502
unitId: 1
pollingRate: 500
expose:
parent: /ua:Objects/di:DeviceSet
object: AHU
points:
- name: SupplyAirTemperature
at: holding:10
type: int16
scale: 0.1
unit: degC
- name: CoolingValveOpen
at: coil:3
type: bool
access: RW
The value
brownfieldDevices.modbus: is a list. Each entry is a Modbus connection.
A Modbus connection
One Modbus TCP device. It holds the points that the gateway reads.
| Key | What it does | Value | Required |
|---|---|---|---|
name | The name of the connection. A mapping entry starts a reference with it: modbus: <name>:<point>. | text | yes |
type | The transport. TCP is the only transport that works today. The gateway refuses Serial. | TCP, Serial | yes |
address | The IP address of the device, for example 192.168.1.40. | text | |
port | The TCP port of the device. The usual Modbus port is 502. | number | |
unitId | The Modbus unit identifier of the device (the slave id). The default is 1. | whole number | |
endianness | The register layout of the device for values larger than 16 bits. A point can set its own. The default is ABCD. | ABCD, BADC, CDAB, DCBA | |
pollingRate | How often the gateway reads the registers of the points, in ms. The default is 1000. A point can set its own. | number | |
maxGap | The number of unused registers that one read can contain. The gateway reads across a gap this size instead of making two reads. The default is 8. | whole number | |
estimatedTransactionMs | The time in ms that the gateway assumes for one Modbus request when it checks the poll plan. The default is 10. Use a lower value for a fast TCP link. | number | |
expose | Where the gateway puts the device in the address space: an Object below parent: that has one variable for each point. | Modbus expose entry | |
points | The values to read from the device. Each point has a name, an address and a type. | list of Modbus point | |
import | Mapping files to import, for example a vendor export of the register map. The gateway reads the points from the files. | list of Modbus import | |
tables | The register ranges to poll. The gateway makes them from the points. Declare tables only to set the poll plan yourself. | list of Modbus table | |
tags | Deprecated for Modbus. Declare points instead. | list of tag |
A Modbus expose entry
Says where the gateway puts the device in the address space: an Object below a parent node.
| Key | What it does | Value | Required |
|---|---|---|---|
parent | The browse path of the node that holds the device Object, for example /ua:Objects/di:DeviceSet. | text | yes |
object | The browse name of the device Object. The default is the name of the connection. | text | |
nodeIdPrefix | The start of the node id of each variable. The default is s=<connection>.<object>.. | text |
A Modbus point
A named value of a Modbus device: its address, its type and how to scale it.
| Key | What it does | Value | Required |
|---|---|---|---|
name | The name of the point. A mapping entry uses it: modbus: M1:<name>. The name stays the same when a new import changes the register numbers. | text | yes |
at | Where the value is: <table>:<address>, for example holding:10. The table is coil, discrete, holding or input. The address starts at 0. Use modicon:400011 for a 1-based Modicon number, and holding:10.3 for bit 3 of a register. | text | yes |
type | The data type in the register or registers: int16, float32 and so on. It gives the width and the decoding. A float32 or int32 point uses 2 registers. | text (a fixed list) | yes |
displayName | A name for people. The default is the name of the point. | text | |
count | The number of elements, for an array or a string. The default is 1. | whole number | |
endianness | The register layout of this point. The default is the endianness of the connection. | ABCD, BADC, CDAB, DCBA | |
scale | A multiplier for the raw value: engineering = raw * scale + offset. | number | |
offset | A number that the gateway adds after the multiplication by scale. | number | |
sqrtRange | A square-root scale between a raw range and an engineering range. Differential-pressure flow transmitters use it. Do not combine it with scale or offset. | square-root range | |
scaleRegister | The address of a second register that holds a power-of-ten scale factor, for example holding:200. The gateway reads it at each poll. | text | |
unit | The engineering unit, for example degC. The gateway publishes it on the variable. | text | |
range | The low and high limit of the value. The gateway publishes it as the engineering range of the variable. | engineering range | |
access | What the device permits: RO (read only), RW (read and write) or WO (write only). The default is RO. The gateway does not write to devices today. | RO, RW, WO | |
writeFcPolicy | The Modbus function codes for a write. auto (the default) uses a single write when one register is enough. forceMultiple always uses a multiple write, for a device that supports only that. The gateway does not write to devices today. | auto, forceMultiple | |
invalid | Raw values that mean "no reading", for example [-32768]. The gateway then publishes BadDataUnavailable. Write a value above 2^53 as a text. | list of whole number or text | |
bitmask | A mask for a bit field in a 16-bit register. The type must be int16, uint16 or bool. | whole number | |
pollingRate | How often the gateway reads this point, in ms. The default is the pollingRate of the connection. | number | |
samplingInterval | The sampling interval, in ms, that the variable of this point shows to OPC UA clients. | number | |
node | The browse path of a variable that already exists. The gateway then gives the value to this variable and does not make a new one. | text | |
value | A JSONata expression that replaces the standard decoding. Use it only when the other keys cannot express the calculation. | text | |
description | A text for people. The gateway puts it in the Description attribute of the variable. | text |
A Modbus import
A mapping file from a vendor tool. The gateway reads the points from the file.
| Key | What it does | Value | Required |
|---|---|---|---|
file | The path of the mapping file, relative to the folder of the configuration file, for example profiles/tags.csv. | text | yes |
format | The format of the file. auto (the default) finds the format from the file. Set it when the gateway cannot find it. | text (a fixed list) | |
addressBase | Says if the file uses addresses that start at 0 or at 1. auto (the default) uses the convention of the format. | auto, 0, 1 | |
endianness | The register layout that the file assumes for values larger than 16 bits. It applies to the imported points. | ABCD, BADC, CDAB, DCBA | |
kepwareZeroBased | Set to false when a Kepware export does not use zero-based addressing. | true or false | |
include | Name patterns. The gateway imports only the points that match. | list of text | |
exclude | Name patterns. The gateway does not import the points that match. | list of text | |
overrides | Changes for single points, applied after the gateway reads the file. Use them to rename, retype or bind a point without an edit of the vendor file. | list of override of an imported point |
A Modbus table
A range of registers that the gateway polls. Use points for a new configuration.
| Key | What it does | Value | Required |
|---|---|---|---|
type | The register table to poll: coils, discreteInputs, holdingRegisters or inputRegisters. | coils, discreteInputs, holdingRegisters, inputRegisters | yes |
start | The first register of the table. The address starts at 0. | number | yes |
length | The number of registers in the table. | number | yes |
pollingRate | How often the gateway reads the table, in ms. | number | yes |
A tag
A named value of a device, with its address. A tag documents the layout of the device.
| Key | What it does | Value | Required |
|---|---|---|---|
name | The name of the tag. It is unique in the connection, for example BoilerTempRaw. | text | yes |
address | The address of the value, without the connection name. The syntax depends on the protocol: DB1,INT2 for S7. | text | yes |
dataType | The data type in the protocol of the device, for example INT16 or FLOAT. | text | |
description | A text for people. The gateway puts it in the Description attribute of the variable. | text |
A square-root range
The raw and engineering limits for a square-root scale, as used by flow transmitters.
| Key | What it does | Value | Required |
|---|---|---|---|
rawLow | The raw value at the low end of the range. | number | yes |
rawHigh | The raw value at the high end of the range. | number | yes |
scaledLow | The engineering value at the low end of the range. | number | yes |
scaledHigh | The engineering value at the high end of the range. | number | yes |
An engineering range
The low and high limit of the value of a point. The gateway publishes it on the variable.
| Key | What it does | Value | Required |
|---|---|---|---|
low | The low end of the engineering range. | number | yes |
high | The high end of the engineering range. | number | yes |
An override of an imported point
Changes one imported point without a change to the vendor file.
| Key | What it does | Value | Required |
|---|---|---|---|
point | The name of the imported point to change. A name pattern is allowed. | text | yes |