plcpeople / nodepccc

Library for node.js to communicate with some Allen-Bradley programmable controllers (PLCs)
MIT License
81 stars 24 forks source link

Communication timeout causing node red crashes #24

Closed mariusss21 closed 6 years ago

mariusss21 commented 6 years ago

Hello,

first of all, thanks for your great library.

I'm using your library to communicate with a CompactLogix L33ERM and I'm getting this error in case of communication failure.

26 May 12:50:27 - TypeError: Cannot read property 'length' of undefined at processSLCWriteItem (/usr/lib/node_modules/node-red-contrib-ccc/node_modules/nodepccc/nodePCCC.js:1572:13) at NodePCCC.writeResponse (/usr/lib/node_modules/node-red-contrib-pccc/node_modules/nodepccc/nodePCCC.js:1270:17) at NodePCCC.packetTimeout (/usr/lib/node_modules/node-red-contrib-pccc/node_modules/nodepccc/nodePCCC.js:232:8) at Timeout._onTimeout (/usr/lib/node_modules/node-red-contrib-pccc/node_modules/nodepccc/nodePCCC.js:1023:24) at ontimeout (timers.js:393:15) at tryOnTimeout (timers.js:250:5) at Timer.listOnTimeout (timers.js:214:5)

plcpeople commented 6 years ago

This was obviously a bug - please let me know if you still see issues following the attempted fix.