Cloud-Automation / node-modbus

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

Please edit the WriteSingleCoil.js existing in examples/javascript/serial. #297

Closed sungyeon-0975 closed 2 years ago

sungyeon-0975 commented 2 years ago
socket.on('connect', function () {
  client.writeSingleCoil(4, true).then(function (resp) {
    console.log(resp)
    socket.close()
  }, function (err) {
    console.log(err)
    socket.close()
  })
})

not working. so I modify 'connect' to 'open'. then it works. so plz, check examples/javascript/serial/WriteSingleCoil.js.

stefanpoeter commented 2 years ago

@sungyeon-0975 Always happy for pull requests.