-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TCP id #12
Comments
ModBus TCP devices not having id. For TCP id replaced to ip address. 2014-12-07 14:31 GMT+06:00 bShnaider notifications@github.com:
Contacts: http://tuxnsk.ru/ |
I have several slave which connected serial on the same bus but all beyond tcp/ip communication card, so i have to create TCP connection. There is no option to request data from specific slave? Is there any other option? |
Use my fork of jsmodbus for that. Unfortunately no documentation, just read On Sunday, December 7, 2014, bShnaider notifications@github.com wrote:
Pozdrawiam, |
I want used TCP slaveid ,but this cannot connect to specific slave with specific id |
I was able to do it with this project: |
You could also use native functions. Check this example from README: var log = console.log;
var native = require('modbus').native;
// create context
var ctx = native.new_tcp("127.0.0.1", 1502);
/* Here you can set the slave id */
native.set_slave(ctx, 255);
// connect to slave device
native.connect(ctx);
// get value
var result = [];
native.read_registers(ctx, 2, 1, result);
log(result[0]);
// set value
native.write_bit(ctx, 1, native.OFF);
// close context
native.close(ctx);
native.free(ctx); |
hi,
How can I connect to specific slave with specific id?
In the RTU connection I specify the slave Id when creating connection while in the TCP connection there is no option.
I would appreciate your help,
thanks.
The text was updated successfully, but these errors were encountered: