Modbus Reader Documentation
Module ID: 0cb1e9b3-e809-4f7d-b67c-5a430d267909 Version: 7.2.0 Retrieved: 2025-10-09 15:16:04
Modbus Reader
The module is used to read values from a modbus slave. Several values can be grouped together in the same reader by adding several values to the list of tags to read.
Settings
In the settings you specify the address and port of the modbus slave. The PLC and corresponding tags are imported from a predefined resource. When selecting the PLC you will see all tags that will be read, and you can complement this set by adding your own tags. You can also specify the byte order of the input data.
| Name | Requirements | Purpose | Default |
|---|---|---|---|
| IP Address | The modbus slave to connect to | - | |
| Disable module if no IP address is specified | bool | If true the flow will not attempt to start the module if no IP Address is configured | false |
| Port | number | The port to use when connecting to the slave | 502 |
| Use shared connection | bool | If checked, the module will use the same connection as other Modbus modules using shared connections and the same IP. | false |
| Target Property | String with length 1-64 | The property to write the result into. Note that dot-notation is allowed to write the result into a sub-object. | data |
| Tags collection (Resource) | The resource that contains all tags to read. | ||
| Additional tags to monitor | An input table for extra tags to read. | ||
| Timeout Settings | See separate Timeout Settings section | ||
| Byte Order | The byte order of the input data. | BigEndian |
Resource Format
Example of the resource file format.
{
"name": "SimPLCv3-250",
"unitId": "1",
"tags": [
{
"id": "Reg0",
"name": "Reg0",
"modbusDataType": "UShort",
"modbusFunction": "ReadHoldingRegisters",
"address": "0000",
"unitId": "2"
}
]
}
The properties of the tags are described in the following Additional tag properties section.
In addition to these properties, any number of extra fields can be added for each tag when defining tags in the Tags collection resource file. Those fields are then added to the output messages. Use this to add additional metadata associated with each tag.
Additional tag properties
| Name | Requirements |
|---|---|
| Id | String with min length 1. Needs to be unique within all tags |
| Name | Optional string. If not specified, 'name' = 'id'. |
| DataType | A valid Modbus tag datatype |
| Function | A valid Modbus function |
| Address | In Hex format |
| BitPosition | Bit position in the register (only for bit) |
| Length | The number of registers. Only valid for String DataType. Valid range: 1-125 . Most modbus implementations use 2 chars per register |
| UnitId | If set, this unit id is used for the tag. If not set the default unit id will be used |
Timeout Settings
| Name | Requirements | Purpose | Default |
|---|---|---|---|
| Read/Write Timeout (milliseconds). | Number larger than or equal to 0. | The read/write timeout before the communication will fail. 0 means infinite. | 60000 |
| Retries. | Number larger than or equal to 0. | The number of retries to communicate before communication will fail. | 0 |
| Wait Between Retries (milliseconds). | Number larger than or equal to 0. | The number of milliseconds to wait between each communication retry. | 0 |
| Status Busy Uses Retry Count. | Boolean (true/false). | If true status busy from the Slave will be included in retry count. | false |
Byte Order
The byte order of the input data can be specified in the settings. The following options are available:
| Name | Description | Example |
|---|---|---|
| BigEndian | High order byte first. | ABCD |
| BigEndianWithByteSwap | Big Endian with byte swap. | BADC |
| LittleEndian | Low order byte first. | DCBA |
| LittleEndianWithByteSwap | Little Endian with byte swap. | CDAB |
Input
Any message can be used to trigger a read operation from the PLC.
Output
Each tag will be added to an array assigned to the Target property. Each object of the array will contain the following properties:
| Name | Type | Description |
|---|---|---|
| id | string | The tag to read from the modbus slave. |
| name | string | The friendly name set to the tag. |
| value | object | The value/result from the modbus slave for the specific tag |
| unitId | string | The unit id in hex used for the specific tag |
# Output
{
"crosser": {
"success": true
},
"data": [
{
"id": "test1",
"name": "test1",
"value": 32041,
"unitId": "1"
},
{
"id": "test2",
"name": "test2",
"value": 2
"unitId": "25"
},
{
"id": "id3",
"name": "double",
"value": 125.63,
"unitId": "AF"
}
]
}
Search Documentation
Industrial