Control Netio Power Distribution Units using Modbus/TCP

This application note, and the method it describes, requires Blocks version 6.3.1 or later. All current models of Netio's Power Distribution Units (PDU) support Modbus. The Modbus method requires less configuration compared to the MQTT method, while providing access to all properties of the device, including power metering.

Setup in the Device

Use the vendors documentation to access the devices web interface. Find the M2M Api tab and enable the modbus/tcp option. Blocks does not support changing the Modbus port, so leave that set to 502. The IP-filter is recommended in systems where the network may be publicly exposed, and should be set to your Blocks server's IP-adress.

Setup in Blocks editor

Channel addressing

Consult the vendor device manual to find out the register settings for the property to access. Add the modbus device, select the modern 16-bit addressing option set the conccurent queries option to 1 and give the device a unique permanent and meaningful name.

Setup sockets

Add a modbus channel, give it a unique for the device, permanent and meaningful name, set the type to Digital (bit), set the direction to out. This will result Blokcs using modbus function 15 (Write Multiple Coils) (Blocks does not support Function 5 (write single coil) That means it sends the current property of all coils in a single call to the device in a single call.

For Netio devices always add as many sockets as the device has. If the device supports two sockets add both, if it supports 4, add all four. The device does not support the way coils are set by Blocks unless all sockets are present.

:!: It is important to not add coil channels that are not available on the device since the device will not perform any actions att all. They can then be accessed in blocks with their respective modbus channel property.

Setup metering (read analog values)

Some NETIO devices support extensive power metering options. From the manual we can find the register we want to access, i.e the Mains Voltage of the device is accessed on Register 1, Function 04 and it is a 16 bit Type.

As an example, to get the device mains voltage, for the new channel in Blocks, we enter channel number 2, give the channel a reasonable name, select the Analog-16bit-word type and set the direction to in.

Example configuration in Blocks