Modbus Writer Documentation
Version:Â 3.0.0Â
Retrieved:Â 2025-10-09 15:16:04
Modbus Writer
The module is used to write values to a modbus slave. The module will write values when a message is received from a previous module and then pass the result to the next module(s) in the flow.
Settings
| Name | Requirements | Purpose | Default |
|---|---|---|---|
| IP | String with length 1 to 39 | IP Address of the PLC to use. |  |
| Port | Number 1 to 65000 | Port of the PLC to use | 502 |
| Use shared connection | Boolean | If checked, the module will use the same connection as other Modbus modules using shared connections and the same IP. | false |
| Source Property | String with length 1 to 64 | The property that contains the value to write | data |
| Use Tag Specification from Message | Boolean | If not checked the Tag Specification has to be set in settings | false |
| Tag Specification | See below | Â | Â |
Tag Specification
The data types for the properties on the tag object are described below. They are expected to be set on a property modbus in the message.
| Name | Requirements |
|---|---|
| unitId | Address of the device to write to in byte 0 - 255 |
| dataType | One of (Bool, Byte, Short, UShort, Int, UInt, Long, ULong, Float, Double, String) |
| function | One of (WriteCoils, WriteHoldingRegisters) |
| startAddress | Address 0 - 65535 |
| writeSingleRegisters | Bool Should each register be written on at the time (WriteSingleRegisters function used) |
| byteOrder | BigEndian, LittleEndian, BigEndianWithByteSwap or LittleEndianWithByteSwap |
Note
The combination of dataType, function and byteOrder is validated. Bool can only be used with WriteCoils and vice versa. WriteHoldingRegisters can be used with all types but Bool.
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 |
Examples
Example with passing only value on input message
# Settings:
IP Address = 192.168.2.15
Port = 502
Use shared connection = false
Source Property = data
Use Tag Specification from Message = false
Tag Specification:
unitId = 1
dataType = Short
function = WriteHoldingRegisters
startAddress = 0
writeSingleRegisters = false
byteOrder = 01
# Incoming message:
{
data : 123
}
# Outgoing message:
{
data : 123,
crosser : {
success : true
}
}
Example with passing value and Tag Specification on input message
# Settings:
IP Address = 192.168.2.15
Port = 502
Use shared connection = false
Source Property = data
Use Tag Specification from Message = true
# Incoming message:
{
data : 123,
modbus: {
unitId: 1,
dataType: 'Short',
function: 'WriteHoldingRegisters',
startAddress: 0,
writeSingleRegisters: false,
byteOrder: '01',
}
}
# Outgoing message:
{
data : 123,
modbus: {
unitId: 1,
dataType: 'Short',
function: 'WriteHoldingRegisters',
startAddress: 0,
writeSingleRegisters: false,
byteOrder: '01',
},
crosser : {
success : true
}
}
Output
Output will be the same as the input including a crosser object that reports if the operation was a success or not.
Search Documentation
Industrial