Documentation

July 29, 2019

The documentation is provided with libmodbus releases as man pages (generated from doc sources. You can also browse the documentation of the different releases of libmodbus:

See the Wiki for general informations.

Code Sample

#include <stdio.h>
#include <modbus.h>

int main(void) {
  modbus_t *mb;
  uint16_t tab_reg[32];

  mb = modbus_new_tcp("127.0.0.1", 1502);
  modbus_connect(mb);

  /* Read 5 registers from the address 0 */
  modbus_read_registers(mb, 0, 5, tab_reg);

  modbus_close(mb);
  modbus_free(mb);
}

External Documentation