This is an old revision of the document!


Control NETIO PDU using Modbus/TCP

Work in progress. Currently on hold.

This application note assumes minimum Blocks v 6.3.1. At time of writing all current models of Netio power distribution units support modbus via its M2M (machine2machine) This method has less configuration compared with the option to use MQTT. It gives access to all properties available on 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 modbus default port so please leave that at 502. The IP-filter is recommended to use in any system where the network is exposed in anyway to the general public. That should be set to the Blocks servers IP-adress.

Channel addressing

Consult the vendor device manual to find out the register settings for the property to access. Add a modbus channel, select the modern 16-bit addressing option and give it a unique permanent and meaningful name. Enter the register address, select the appropriate data type and direction. The modbus function is automatically derived from the data type and direction.

Control the 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 in 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 message.

Add as many channels as the device support. If the device support two outlets add both, if it supports 4 add all four.

:!: It is very important to not add sockets that is 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 Boolean property.

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 the get the device voltage we enter channel number 2, select the Analog-16bit-word type and direction in. This will result in a new channel using Function 4.