I am trying to implement Modbus RTU Master in Digi connect me 9210 device. For this purpose I am using libmodbus library.
What would be device name I have to give in NetOs to connect with my local Computer.?
Now I am using
ctx = modbus_new_rtu(“COM3”, 19200, ‘N’, 8, 1);
modbus_set_slave(ctx, SERVER_ID);
/* TCP */
// ctx = modbus_new_tcp(“10.0.0.66”, 502);
modbus_set_debug(ctx, TRUE);
if (modbus_connect(ctx) == -1) {
fprintf(stderr, "Connection failed: %s
",
modbus_strerror(errno));
modbus_free(ctx);
return -1;
}
But its keep saying connection failed. I have also tried “/dev/USB0” and “/dev/ttyS0”. I have Modbus Slave in my local computer to test with the Module client.