pycomm icon indicating copy to clipboard operation
pycomm copied to clipboard

"Timed out" Issue

Open A-Badkoubeh opened this issue 7 years ago • 4 comments

I am using the example for Micrologix PLC. After a few minutes, I am getting "timed out". Any ideas what potentially can cause this "timed out"?

A-Badkoubeh avatar Feb 10 '18 01:02 A-Badkoubeh

You didn't give much info, but keep in mind that if you are 'routing' to get to the PLC, for example from your desk or control room to a factory floor, then a TCP/IP socket will likely 'die' very ungracefully if it is idle for 5 minutes. This is a router/firewall thing, unrelated to CIP timeouts. So if you are polling once a minute, then this isn't the problem, but if you have been idle, then try to talk, the socket might now be broken. You'd need to enable 'TCP keepalive' on the socket.

lynnlinse avatar Feb 11 '18 19:02 lynnlinse

How can I enable 'TCP keepalive' on the socket? Second, I need to reach 1ms speed for reading one Integer (e.g. N7:0) is it possible to reach this cycle time using Pycomm? Thank you very much.

A-Badkoubeh avatar Feb 11 '18 21:02 A-Badkoubeh

If you get those kinds of speeds let me know what you did. As is, I struggle to keep my reads under 1s.

davisjosephh avatar May 24 '18 19:05 davisjosephh

I have the same issue with this for reading one tag it takes about 60-70 ms and i am reading 18 tags in a while loop the problem arise when i write a plc tag from another script and just after writing tag, on the first script its throws :

Traceback (most recent call last): File "experiment-initial-screen.py", line 18, in valve_class = c.read_tag('N7:2')#old N7:3 File "/home/hydro/.local/lib/python2.7/site-packages/pycomm/ab_comm/slc.py", line 271, in read_tag addr_data=self._target_cid,)): File "/home/hydro/.local/lib/python2.7/site-packages/pycomm/cip/cip_base.py", line 590, in send_unit_data self._receive() File "/home/hydro/.local/lib/python2.7/site-packages/pycomm/cip/cip_base.py", line 770, in _receive raise CommError(e) pycomm.cip.cip_base.CommError: timed out

it happens every time i do a read or write operation simultaneously any ideas? Actual visualization : Stackoverflow

Nsp2121 avatar Aug 08 '18 12:08 Nsp2121