Cloud-Automation / node-modbus

Modbus TCP Client/Server implementation for Node.JS
456 stars 169 forks source link

Add a method to set slaveId / unitId #313

Closed saguado69 closed 1 year ago

saguado69 commented 1 year ago

I would like to poll mutiple Modbus Slave Units. There is a property to read the slaveID/unitID but there is no method to change the slaveID once the client instance is created (new Modbus.client.TCP(socket, X)). It will be very nice to have this feature. In my case, the slaves to be polled will vary depending on a csv file.

Thanks in advance for your support and help.

Santi.

stefanpoeter commented 1 year ago

Hey @saguado69,

changing slave or unit Ids should not be possible. When communication starts the slave ID should remain the same. If you want to poll multiple server create a client instance for every id.