Home/Support/Support Forum/Modbus RTU Master Connect me 9210
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Modbus RTU Master Connect me 9210

0 votes
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\n",
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.
asked Jan 27, 2016 in NET+OS by mhdazeem Community Contributor (55 points)
edited Jan 27, 2016 by mhdazeem

Please log in or register to answer this question.

2 Answers

0 votes
I'm not for sure on this, but if you take a look at \netos75\src\examples\uart you can the use of a format like this:

#define RX_PORT_NAME "/com/0"

Worth a try...
answered Jan 29, 2016 by marzahld New to the Community (5 points)
0 votes
Thanks for the reply. But I have sorted out this issue. It was related to the flags used in libmodbus (Not supported by Digi). So I changed the flags to open the device (serial port "/com/0 (default port)").
answered Feb 1, 2016 by mhdazeem Community Contributor (55 points)
Thanks. I have already sorted this issue.
...