node-modbus-serial icon indicating copy to clipboard operation
node-modbus-serial copied to clipboard

writeCoil doesn't work while not giving any error

Open bkorumaz opened this issue 3 years ago • 3 comments

This code block doesn't work while it is not giving any error. I am able to write to this coil with the same IP adress, port and coil adress on QModMaster Application. What would be causing not to write to this coil?

I have put time interval between steps related to this topic #457

not working

bkorumaz avatar Jul 03 '22 17:07 bkorumaz

HI, thank you for the question, if you want to catch an error, you need to use .catch see: https://github.com/yaacov/node-modbus-serial/blob/master/examples/write.js#L27

yaacov avatar Jul 04 '22 10:07 yaacov

This isn't working either. I can see the light blinking right next to ethernet port when I run the script. I think it means that program can connect succesfully. Unfortunately writeCoil function didn't work. I believe this program should work. What do you think might be the problem? anotherExample

bkorumaz avatar Jul 04 '22 13:07 bkorumaz

I successfully write to coil when I changed the adress with 2049. I should have write 2049 to address in order to change the value stored in the coil addressed 2050.

bkorumaz avatar Jul 04 '22 13:07 bkorumaz