Cloud-Automation / node-modbus

Modbus TCP Client/Server implementation for Node.JS
465 stars 174 forks source link

how to change device address #207

Closed vidding closed 6 years ago

vidding commented 6 years ago

How to change device address in serial port mode? I see the code in line 76 of modbus-serial-client.js var base = Buffer.from([0x01]) Is it to modify 0x01?

stefanpoeter commented 6 years ago

The ModbusRTUClient musst be instantiated with the address like this

let client = new modbus.client.RTU(socket, address)