Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
blocks:app-note:netio_modbus [2024-03-14 14:06]
mattias [Control NETIO PDU using Modbus/TCP]
blocks:app-note:netio_modbus [2024-03-14 15:06] (current)
admin [Setup in the Device]
Line 1: Line 1:
-=====Control NETIO PDU using Modbus/TCP===== +=====Control Netio Power Distribution Units using Modbus/TCP=====
-Work in progress. Currently on hold. +
  
-This application note assumes minimum Blocks 6.3.1. +This application note, and the method it describes, requires Blocks version 6.3.1 or later
-At time of writing all current models of Netio power distribution units support modbus via its M2M (machine2machine+All current models of Netio's Power Distribution Units (PDUsupport Modbus. 
-This method requires less configuration compared with the option to use MQTT.  It gives access to all properties available on the device including power metering. +The Modbus method requires less configuration compared to the [[blocks:app-note:netio|MQTT method]], while providing access to all properties of the deviceincluding power metering. 
  
 ====Setup in the Device==== ====Setup in the Device====
Line 10: Line 9:
 Find the M2M Api tab and enable the modbus/tcp option.   Find the M2M Api tab and enable the modbus/tcp option.  
 {{:blocks:app-note:netio_modbus:netiomodbus.png|}} {{:blocks:app-note:netio_modbus:netiomodbus.png|}}
-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.+Blocks does not support changing the Modbus portso 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'IP-adress.
  
-====Channel addressing====+=====Setup in Blocks editor==== 
 +===Channel addressing===
 Consult the [[https://www.netio-products.com/files/NETIO-Modbus-TCP_M2M-API-Protocol.pdf|vendor device manual]] to find out the register settings for the property to access.   Consult the [[https://www.netio-products.com/files/NETIO-Modbus-TCP_M2M-API-Protocol.pdf|vendor device manual]] to find out the register settings for the property to access.  
-Add 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.  +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.
  
-====Control the sockets====+:!: 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.
  
-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 call.  +===Setup metering (read analog values) ===
- +
-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 coil channels 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.  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. 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.
Line 35: Line 32:
 {{:blocks:app-note:netio_modbus:netioregister.png|}} {{:blocks:app-note:netio_modbus:netioregister.png|}}
  
-As an example, to the get the device voltage we enter channel number 2, select the Analog-16bit-word type and direction in. +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. 
-This will result in a new channel using Function 4. +
  
 ====Example configuration in Blocks==== ====Example configuration in Blocks====