node-modbus-serial
node-modbus-serial copied to clipboard
TransactionTimedOutError & PortNotOpenError while using connectTcpRTUBuffered.
Hi,
I am trying to implement Modbus RTU over TCP. I am using connectTcpRTUBuffered and getting TransactionTimedOutError and PortNotOpenError. Below is the code snippet and error log.
Referred to, https://github.com/yaacov/node-modbus-serial/issues/117 However, my current version of library is 7.8.1
Here is my code - modbusScript.txt
Error -
I also referred to - https://github.com/yaacov/node-modbus-serial/issues/447 and used connectTelnet and it worked when I read a single memory address. In case when I uncomment the second setInterval from the attached snippet, it runs for a couple of iterations and again throws TransactionTimedOutError & PortNotOpenError. Refer below error log -
I would want to understand what is causing these errors in the case of connectTcpRTUBuffered and how can it be resolved. Similarly, why do these errors occur in case of connectTelnet while reading multiple memory address?
Any help on this will be highly appreciated.
@yaacov