The Modbus plugin is designed to work with devices using the Modbus protocol.
Double-click on the plugin line to open the plugin properties window:
On the Options tab, fill in the following fields:
- Transport – currently only Modbus TCP
- IP – address of the device (controller)
- Port – device port (for Modbus, default is 502)
- Waiting for a response to a request – time to wait for a response from the device (controller) to the request. If the timeout is exceeded, the plugin proceeds to the next request.
- Interval between requests – some devices (controllers) cannot process requests with a small interval. We recommend that you leave the default – 100ms
- The maximum number of words when reading a range. The plugin is able to read information from the device (controller) not in separate registers, but in blocks. The plugin automatically forms the range of the information block. Here you can set the maximum size of one block.
- Byte order for 2 byte values. In different devices (controllers), this order is defined differently. You need to install as specified in your device (controller).
- Byte order for 4 byte values. You need to install as specified in your device (controller).
Press the button to call the channel list and select “Channel List”:
Press the “+” button
In the channel properties window, fill in the following fields:
- Channel – the name of the channel. Any alphanumeric designation.
- Device Type – select the appropriate type from the list.
- Unit ID – device address on the bus. If the device is one, the address is usually 1.
- Register Address – Register address in the Modbus table
- Type of variable.
- Modbus function.
- Group when reading. If the daw is not installed, this register will be read in a separate request. If installed, the plugin generates one request for a group of registers. This significantly increases the speed of polling registers.
In addition, if you select the “Value conversion” checkbox, you can set the following parameters:
- The minimum value of the logical level
- The maximum value of the logical level
- The minimum value of the physical layer
- The maximum value of the physical layer
These parameters allow you to convert user interface values (brightness, level) into values transmitted to Modbus registers. For example, an air vent is displayed on the interface. She has an angle of rotation from 0 to 90 degrees. And at the physical level, values from 0x1999 to 0x7FFF are transferred to the registers.
Physical layer values can be entered both in decimal (154) and in hexadecimal (0x9A).
After saving the channel, it becomes possible to bind the channel to the virtual device:
On the Processing tab, the following server-side information processing options are available:
- Invert input value. For example, from standard motion sensors comes zero at a trigger. This is not convenient when displaying on a mnemonic diagram and further processing in scripts.
- Invert the output value. Applies to discrete actuators only.
- The formula for calculating the input value. For example, a value of 247 is received from the temperature sensor. You can immediately convert it to 24.7 by the formula: value/10
- The formula for calculating the output value. Similar to the example above, but in the opposite direction.
- Do not wait for the confirmation command. The standard system algorithm involves displaying the state only after receiving the real value from the device. But some slow devices send a confirmation of a command with a long delay. If you check this box, the system will perform operations without waiting for confirmation. For example, when you click on the lamp icon, it will instantly change state without waiting for confirmation from a real device.
The second application of this option: work with devices that, in principle, do not have feedback.
If one register is used to read the device status, and another register is used for the control command, you need to check the “Configure commands” box:
The “Commands” tab will appear:
- Command – On (Off), Off (Off), Set the value (Set)
- Register address in Modbus table – register address for control command
- Type of variable.