7 modbus_connect - establish a Modbus connection
12 *int modbus_connect(modbus_t *'ctx');*
17 The _modbus_connect()_ function shall etablish a connection to a Modbus server,
18 a network or a bus using the context information of libmodbus context given in
24 The modbus_connect() function shall return 0 if successful. Otherwise it shall
25 return -1 and set errno to one of the values defined by the system calls of the
35 ctx = modbus_new_tcp("127.0.0.1", 502);
36 if (modbus_connect(ctx) == -1) {
37 fprintf(stderr, "Connection failed: %s\n", modbus_strerror(errno));
46 linkmb:modbus_close[3]
51 The libmodbus documentation was written by Stéphane Raimbault
52 <stephane.raimbault@gmail.com>