Overview
This node enables interaction with MODBUS devices by reading from or writing to their memory registers or coils. It is useful in industrial automation, building management systems, and IoT scenarios where MODBUS protocol is used for communication with hardware devices such as sensors, actuators, or controllers.
Typical use cases include:
- Reading sensor data or device status from MODBUS registers.
- Writing control commands or configuration values to MODBUS registers or coils.
- Turning devices on or off by toggling coil states.
For example, you can read temperature values stored in specific registers or switch a motor on/off by writing to a coil.
Properties
Name | Meaning |
---|---|
Memory Address | The memory address (register index) to read from or write to. |
Value | The numeric value to write to the specified register (range: -32768 to 32767). |
Coil Value | The coil state to write; options are "On" (65280) or "Off" (0). |
Note:
- The Value property is shown only when writing to a register.
- The Coil Value property is shown only when writing to a coil.
Output
The node outputs an array of JSON objects containing a data
field:
- For read operations,
data
is an array of signed 16-bit integers representing the values read from the requested MODBUS registers. - For write operations,
data
contains the response object returned by the MODBUS device confirming the write action.
No binary data output is produced by this node.
Dependencies
- Requires connection credentials to a MODBUS device, typically including network parameters and authentication details.
- Uses an internal MODBUS client library to communicate with the device.
- The node expects proper configuration of the MODBUS API credentials within n8n.
Troubleshooting
- MODBUS Error: If the node throws errors prefixed with "MODBUS Error:", it indicates communication issues with the device or invalid parameters.
- Verify that the device is reachable and powered on.
- Check that the memory address and quantity values are valid and supported by the device.
- Ensure correct credentials and network settings are configured.
- Invalid Value Range: Writing a register value outside the allowed range (-32768 to 32767) may cause errors.
- Incorrect Coil Values: Only the predefined coil values ("On" or "Off") are accepted; using other values will fail.
Links and References
- MODBUS Protocol Specification
- Industrial Automation with MODBUS
- n8n Documentation (for general node usage and credential setup)