Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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:
    1. 16 bits signed int;

    2. 16 bits unsigned int;

    3. 32 bits signed int;

    4. 32 bits unsigned int;

    5. 32 bits IEEE 754 floating point.

  • mb_order - data ordering:
    1. low byte first, low word first;

    2. low byte first, high word first;

    3. high byte first, low word first;

    4. 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):
    1. 16 bits signed int;

    2. 16 bits unsigned int;

    3. 32 bits signed int;

    4. 32 bits unsigned int;

    5. 32 bits IEEE 754 floating point.

  • mb_order - data ordering (for reading only):
    1. low byte first, low word first;

    2. low byte first, high word first;

    3. high byte first, low word first;

    4. 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:

...