Adding Modbus RTU and Modbus TCP devices in Niagara 4
Setting up ModbusAsync and ModbusTCP in Niagara 4: network settings, device addresses, boolean, numeric and writable points, polling, and devices showing down.
Modbus turns up on almost every Niagara job: energy meters, VSDs, heat pumps, generators, chillers. It’s simple compared with BACnet, but it has one big difference that shapes the whole setup: there’s no discovery. Niagara can’t ask a Modbus device what data it has. You add every point by hand from the manufacturer’s register map, or deploy it from a template.
Which driver?
- ModbusAsync handles serial Modbus, usually RTU over RS-485. The JACE’s RS-485 port (or an option card) is the master, and the devices are slaves on a daisy-chained trunk.
- ModbusTCP handles Modbus over Ethernet, normally on TCP port 502. It’s also what you use when talking through a Modbus TCP to RTU gateway.
Modbus TCP and BACnet/IP use different ports, so one JACE can run both side by side on the same network connection.
Serial network settings (ModbusAsync)
On the network, set the serial port and match baud rate, data bits, parity and stop bits to what’s configured in the devices. Every device on the trunk must agree. A single device on the wrong parity can cause errors across the whole trunk. Wiring, termination and biasing all matter too; see RS-485 and MS/TP wiring.
Each device then needs its Modbus address (slave ID, 1 to 247), unique on that trunk.
TCP device settings (ModbusTCP)
Each device needs its IP address, port (normally 502) and a unit ID. Directly connected devices often ignore the unit ID, but gateways use it to pick which serial device behind them you’re talking to. Agree addresses with the client’s IT team, as you would for any other IP device.
Adding points
Open the device’s point manager and add new points. You choose the point type and set the register details in the proxy extension:
| You want | Register type | Niagara point |
|---|---|---|
| Read a status bit | Coil or discrete input | BooleanPoint |
| Switch something on or off | Coil | BooleanWritable |
| Read a value | Input register or holding register | NumericPoint |
| Write a setpoint | Holding register | NumericWritable |
For numeric points, check three things against the register map:
- The address. Is the map’s number a zero-based offset, a one-based register number, or a 40001-style reference? Getting this wrong by one is the most common Modbus fault there is.
- The data type. Is the value a 16-bit integer (signed or unsigned), a 32-bit integer, or a float? And for 32-bit values, what’s the word order?
- The scaling. Many devices send a value ×10 or ×100. Apply the scaling in the point’s conversion settings, then set facets for units and decimal places.
All three are covered in detail in Modbus register offsets and word order in Niagara 4.
Boolean points sometimes come from a single bit inside a holding register rather than a coil. Check whether the device works that way and set the bit number accordingly.
Polling
Niagara polls Modbus devices on a schedule, using poll rates (typically fast, normal and slow) that you assign per point. Put control-critical values on the faster rate, and leave totals and slow-changing data on slow. If you poll hundreds of registers quickly on a 9600 baud trunk, everything will feel sluggish.
Where possible, group points so they sit in contiguous blocks of registers. Niagara can then read several values in a single request, which is much more efficient than one request per point.
When the device shows “down”
Niagara monitors device health by pinging each device on a set register. If that register doesn’t exist in the device, the device can show as down even when points are reading fine. Point the ping at a register you know exists.
After that, work through the usual list:
- Serial: wiring, termination and biasing, baud rate and parity, the slave address, and duplicate addresses
- TCP: whether you can ping the device, the IP address, port and unit ID, and whether a firewall is in the way
- Both: whether the device needs Modbus enabled in its own settings (some do), and whether you’re reading registers it actually supports
Lots of identical devices
If a site has twenty identical meters, don’t build them one at a time. Build and test one properly, with points, tags, alarms, histories and a graphic, turn it into a device template, and then deploy the rest from a spreadsheet using Niagara’s bulk deployment. See palettes, templates and bulk deployment.