Overview
This node listens to MODBUS TCP events by periodically polling a MODBUS device using specified function codes to read coils, discrete inputs, holding registers, or input registers. It is useful for monitoring changes in MODBUS device data in real-time, such as in industrial automation or building management systems. For example, it can trigger workflows when a sensor value changes or when a specific coil state is updated.
Use Case Examples
- Monitoring a temperature sensor connected via MODBUS by reading input registers (FC4) every second and triggering a workflow when the temperature changes.
- Polling discrete output coils (FC1) to detect changes in device status and trigger alerts or actions accordingly.
Properties
| Name | Meaning |
|---|---|
| Function Code | Specifies the MODBUS function code to use for reading data, such as reading coils or registers. Options include FC1, FC2, FC3, and FC4. |
| Memory Address | The starting memory address in the MODBUS device to read from. |
| Quantity | The number of coils, inputs, or registers to read from the device. |
| Polling | The interval in milliseconds at which the node polls the MODBUS device for data. |
| Unit ID | The MODBUS unit or slave ID (0-255) to communicate with. Use 0 if required by the device. |
| Options | Additional optional parameters for the MODBUS request, currently empty. |
Output
JSON
functionCode- The MODBUS function code used for the read operation.address- The memory address from which data was read.quantity- The number of coils/inputs/registers read.data- The array of values read from the MODBUS device. For coils and discrete inputs, this is an array of boolean values; for registers, an array of 16-bit integers.
Dependencies
- Requires a MODBUS API credential for authentication to connect to the MODBUS TCP device.
Troubleshooting
- Ensure the memory address and quantity are valid numbers within the device's supported range; invalid values will cause errors.
- Check that the MODBUS unit ID is correct for the target device; using an incorrect unit ID may result in no response or errors.
- If the node throws an 'Invalid function code' error, verify that the function code parameter is set to one of the supported values (FC1, FC2, FC3, FC4).
- Network connectivity issues to the MODBUS TCP device can cause timeouts or connection errors; verify network settings and device availability.