The element allows to get data from MODBUS TCP device and to write data to MODBUS TCP device.
...
- k - user session ID;
- id - the identifier of the element; if the identifier is absent, a new element is created; otherwise the existing one is modified;
- name - the name of the element, the length is not more than 63 characters;
- virtual_type - type of virtual sensor:
- modbus tcp - for reading Modbus data;
- modbus tcp write - for writing Modbus data.
Options for reading Modbus data only (analog virtual sensor):
- vmax - maximum value for the measuring range;
- vmin - minimum value for the measuring range;
- low_alarm - threshold level for notification;
- low_warning - threshold level for notification;
- high_warning - threshold level for notification;
- high_alarm - threshold level for notification;
- hyst_type - the type of algorithm used to calculate the hysteresis:
- disable - the hysteresis is disabled;
- value - hysteresis by the value measured by the sensor value;
- time - hysteresis using time (used by default).
- hyst_value - the value of the deviation of the sensor value when calculating the hysteresis by value, the value with a floating point (minimum 0, maximum 10,000, default 0.3);
- hyst_low_alarm - the time in seconds, during which the sensor should keep its value in this range, for transition of the sensor to this state (minimum 0, maximum 1000, default 1);
- hyst_low_warning - same as previous (default 1);
- hyst_normal - same as previous (default is 0);
- hyst_high_warning - same as previous (default 1);
- hyst_high_alarm - same as previous (default 1).
- expr - expression for calculating the output value, by default "x";
- um - unit of measurement of this element;
- utype - custom type, defines the sensor icon: current, factor, frequency, humidity, power, temperature, vibration, voltage;
Options for Modbus protocol (reading only):
- mb_ip_addr - IP4 address of device, default 192.168.0.15;
- mb_port - port of device, default 502;
- mb_reg - register index for modbus function, hexademal string;
- mb_func - function code for modbus:
- Read Coil Status (0x01);
Read Input Status (0x02);
Read Holding Register (0x03);
Read Input Register (0x04).
- mb_type - data type:
16 bits signed int;
16 bits unsigned int;
32 bits signed int;
32 bits unsigned int;
32 bits IEEE 754 floating point.
- mb_order - data ordering:
low byte first, low word first;
low byte first, high word first;
high byte first, low word first;
high byte first, high word first.
- mb_period - the polling period, seconds;
- mb_wol_enable - Wake-On-LAN function enable flag, function will not supported if mb_period is less then than 60 seconds;
- mb_wol_timeout - waiting time for awakening remote device after sent Wake-On-LAN magic packet, from 1 to 15 seconds, default 3 seconds;
- mb_wol_mac - MAC address of remote device for send Wake-On-LAN magic packet.
...
When creating a new sensor (id is not specified), some parameters are mandatory. For reading: name, virtual_type, vmax, vmin, mb_ip_addr, mb_port, mb_reg, mb_func, mb_type, mb_order, mb_period. For writing: name, virtual_type, mb_ip_addr, mb_port, mb_reg, mb_func, mb_wrval. The rest of the query parameters are optional, and if not set, they will be set to the default values.
...
- k - user session ID;
- virtual_type - type of virtual sensor:
- modbus tcp - for reading Modbus data;
- modbus tcp write - for writing Modbus data.
- mb_ip_addr - IP4 address of device, default 192.168.0.15;
- mb_port - port of device, default 502;
- mb_reg - register index for modbus function, hexademal string;
- mb_func - function code for modbus:
- Read Coil Status (0x01);
Read Input Status (0x02);
Read Holding Register (0x03);
Read Input Register (0x04);
- Write Single Coil (0x05);
Write Single Register (0x06).
- mb_type - data type (for reading only):
16 bits signed int;
16 bits unsigned int;
32 bits signed int;
32 bits unsigned int;
32 bits IEEE 754 floating point.
- mb_order - data ordering (for reading only):
low byte first, low word first;
low byte first, high word first;
high byte first, low word first;
high byte first, high word first.
- mb_wrval - writing value, integer (for writing only).
...
If no error occurs, the writing test looks like:
<error type="no error" /> |