The element allows to get data from MODBUS RTU device and to write data to MODBUS RTU device.
Requests for management:
addvirtual - add a virtual sensor. Extra options are:
...
- mb_addr - slave address of device on bus, decimal (1-255);
- 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_addr - slave address of device on bus, decimal (1-255);
- mb_reg - register index for modbus function, hexademal string;
- mb_func - function code for modbus:
- Write Single Coil (0x05);
Write Single Register (0x06).
- mb_wrval - writing value, integer.
...
- k - user session ID;
- virtual_type - type of virtual sensor:
- modbus rtu - for reading Modbus data;
- modbus rtu write - for writing Modbus data.
- mb_addr - slave address of device on bus, decimal (1-255);
- 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" /> |
If Modbus is disabled or not supported:
...