Table of Contents |
---|
Connecting Modbus devices
...
A virtual "Modbus TCP" sensor is used to read and write data from external equipment via Modbus TCP/IP protocol.
Support the Wake-on-LAN standard that allows a remote device to be turned on or awakening awakened by a network message.
Adding the Modbus reading virtual element
To create a "Modbus TCP (reading)" element, press add button " " inside the "Group tree" or "System tree" menu. Then choose "Modbus TCP (reading)". A modal window will appear:
...
Click on the "Modbus TCP (reading)". Modbus element form will be opened:
...
Fields in the form available for change:
Name | Description |
---|---|
Name | Created element name |
User-defined type | Defines the icon to be displayed in the "System tree" |
Units of measurement | The unit of measure in which the value is displayed in the "System tree" |
Minimum value |
Determines the minimum measurement range, when the value is out of range, the sensor goes into "Not connected" state | |
Maximum value | Determines the maximum measurement range, when the value is out of range, the sensor goes into a "Not connected" state |
Alarm and warning levels | Defines the alarm and warning thresholds, as for other sensors, see Sensor configuration |
Hysteresis | Option of setting the hysteresis state, see Sensor configuration |
Expression | Function of the form f (x). The default value for the sensor is equal to the measured value: "x", ie corresponds to the expression "x". To calculate the indirect value of the sensor is possible to use an arbitrary expression, which are permissible "(", ")", as well as:
For example: "0.1*x+0.5" |
The Modbus TCP configuration is available in the "Additional" tab:
...
Fields in the form available for change:
Name | Description |
---|---|
IP address | Modbus TCP slave IP address of external equipment |
Port | Modbus TCP slave port (default 502) |
Slave address | Slave address of Modbus TCP |
Register index | Modbus protocol register start address in hexadecimal view, like 0F4A |
Function code | The following functions are supported:
|
Data type | Determines how to present the data:
|
Data ordering | Determines byte order in Modbus protocol response message:
|
Polling period | Defines the time of polling the sensor value. From 10 seconds to 5 minutes. |
Wake-on-LAN function | Enable the Wake-on-LAN function. |
Wake-on-LAN function can only be enabled if the Polling period is from 1 minute and more. | |
Waiting time | Waiting time until the remote device turns on after |
the Wake-on-LAN command. From 1 to 15 seconds. | |
Device MAC address | Wake-on-LAN command |
is sent for the MAC |
address of the remote device. |
To determine the MAC address of the remote device specified in the IP address field click "Get MAC". Make Make sure the remote device is turned on and is not in power-saving mode.
The Test the button allows you to make a test connection with a Modbus device. In additional fields, the bytes sequence bytes sequence of connection, data is displayed, in hexadecimal form. Modbus raw answer - data of the received answer, without a header and checksum. Modbus value - contains the data value interpreted under the selected Data type. Do Do not forget that if the Wake-on-LAN function is enabled, before writing will be a delay at the set time time Waiting time.
Adding the Modbus writing virtual element
To create a "Modbus TCP (writing)" element, press add button " " inside the "Group tree" or "System tree" menu. Then choose "Modbus TCP (writing)". Modbus element form will be opened:
...
Fields in the form available for change:
Name | Description |
---|---|
Name | Created element name |
IP address | Modbus TCP slave IP address of external equipment |
Port | Modbus TCP slave port (default 502) |
Slave address | Slave address of Modbus TCP |
Register index | Modbus protocol register start address in hexadecimal views, like 0F4A |
Function code | The following functions are supported:
|
Writing value | Decimal integer |
value that will be writing in the specified register | |
Wake-on-LAN function | Enable the Wake-on-LAN function |
Waiting time | Waiting time until the remote device turns on after |
the Wake-on-LAN command. From 1 to 15 seconds. | |
Device MAC address | Wake-on-LAN command |
is sent for the MAC |
address of the remote device. |
To determine the MAC address of the remote device specified in the IP address field click "Get MAC".
...
Make sure the remote device is turned on and is not in power-saving mode.
The Test
...
button allows you to make a value entry immediately into the Modbus register.
...
Do not forget that if the Wake-on-LAN function is enabled, before writing will be a delay at the set
...
time Waiting time.
Now the Modbus TCP writing can be inserted as a THEN task in logic schemes:
...
Developer notes: