c - how to implement Modbus RTU Master in Digi Module Connect me 9210 -
i trying implement modbus rtu master in digi module connect me 9210 device. purpose using libmodbus library.
what device name have give in netos connect local computer.?
now 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 keep saying connection failed. have tried "/dev/usb0" , "/dev/ttys0". have modbus slave in local computer test module client.
i have fixed errors . there api issue in digi module while opening default port "/com/0".
also had change libmodbus library little bit work digi because using flags not supported device.
Comments
Post a Comment