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:

  • 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 rtu - for reading Modbus data;
    • modbus rtu wrwrite - for writing Modbus data.

...

  • k - user session ID;
  • virtual_type - type of virtual sensor:
    • modbus rtu - for reading Modbus data;
    • modbus rtu wr 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:
    1. Read Coil Status (0x01);
    2. Read Input Status (0x02);

    3. Read Holding Register (0x03);

    4. Read Input Register (0x04);

    5. Write Single Coil (0x05);
    6. 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:

...