modbus_report_slave_id man page

modbus_report_slave_id — returns a description of the controller

Synopsis

int modbus_report_slave_id(modbus_t *ctx, uint8_t *dest);

Description

The modbus_report_slave_id() function shall send a request to the controller to obtain a description of the controller.

The response stored in dest contains:

Return Value

The modbus_report_slave_id() function shall return the number of read data if successful. Otherwise it shall return -1 and set errno.

Example

uint8_t *tab_bytes;

...

rc = modbus_report_slave_id(ctx, tab_bytes);
if (rc > 1) {
    printf("Run Status Indicator: %s\n", tab_bytes[1] ? "ON" : "OFF");
}

Authors

The libmodbus documentation was written by Stéphane Raimbault <stephane.raimbault@gmail.com[1]>

Notes

1.

stephane.raimbault@gmail.com
mailto:stephane.raimbault@gmail.com

Referenced By

libmodbus(7).

04/02/2014 libmodbus 3.0.6 Libmodbus Manual