We are using your library in our Meteor project. We want to connect to PLC in every 5 seconds to check if values of tags are changed. So I've set an interval like this:
And tags is an array contains items like : 'K1001, 'K1002' etc.
Then i call 'readWritePLCData' method like this:
Meteor.methods({ 'readWritePLCData': function(tags){ ... conn.initiateConnection({port: 44818, host: 'xxx.xx.xx.xx' }, connected); function connected(err){ ... conn.readAllItems(valuesReady); ... } } });
Method is basically a copy of your sample except host ip.
I use your "tagLookup" function and it converts tags above to 'B1:0/2', 'B2:0/4' etc.
When i want to log values in valuesReady callback the output is fine:
This output shows correct boolean values and it is shown every 5 seconds. There never is a "SOMETHING WENT WRONG READING VALUES!!!!" output. But after a few minutes this output shows up:
I20170216-09:16:45.455(2)? [1110077,362847744] Initiate Called - Connecting to P
LC with address and parameters:
I20170216-09:16:45.457(2)? [1110077,362933760] { port: 44818, host: 'xxx.xx.xx.x
x' }
I20170216-09:16:45.458(2)? [1110077,363096064] Connection cleanup is happening
I20170216-09:16:45.459(2)? [1110077,363215872 xxx.xx.xx.xx] Attempting to connec
t to host...
I20170216-09:16:45.545(2)? [1110077,445200384 xxx.xx.xx.xx] TCP Connection Estab
lished to xxx.xx.xx.xx on port 44818 - Will attempt EIP Connection
I20170216-09:16:45.583(2)? [1110077,490686464 xxx.xx.xx.xx] We Caught a connect
error ECONNRESET
I20170216-09:16:45.584(2)? { [Error: read ECONNRESET] code: 'ECONNRESET', errno:
'ECONNRESET', syscall: 'read' }
=> Exited with code: 0
After that, node exists the process and Meteor restarts server and everything is fine until ECONNRESET error occurs in just a few minutes.
Hello plcpeople,
Thanks for this great library.
We are using your library in our Meteor project. We want to connect to PLC in every 5 seconds to check if values of tags are changed. So I've set an interval like this:
Meteor.plcTimer = setInterval(function(){ Meteor.call('readWritePLCData', tags); }, 5 * 1000);
And tags is an array contains items like : 'K1001, 'K1002' etc. Then i call 'readWritePLCData' method like this:
Meteor.methods({ 'readWritePLCData': function(tags){ ... conn.initiateConnection({port: 44818, host: 'xxx.xx.xx.xx' }, connected); function connected(err){ ... conn.readAllItems(valuesReady); ... } } });
Method is basically a copy of your sample except host ip. I use your "tagLookup" function and it converts tags above to 'B1:0/2', 'B2:0/4' etc. When i want to log values in valuesReady callback the output is fine:This output shows correct boolean values and it is shown every 5 seconds. There never is a "SOMETHING WENT WRONG READING VALUES!!!!" output. But after a few minutes this output shows up:
After that, node exists the process and Meteor restarts server and everything is fine until ECONNRESET error occurs in just a few minutes.
Our PLC is CompactLogix 5370 L1.
What may cause this problem and how to solve it?
I really appreciate your help.