Pycomm3 Logix PLC Response Times

Hi Kevin, I am using an AB 1756 with pycomm Logix driver and am having issues getting >100ms per tag read. Do you know if thats normal for that library? should I switch to something else?

Response times >100ms are slow but I'm not certain if you can attribute it to the library or not. Take a Wireshark capture.

Thanks Kevin, I will work do that. In the meantime are there any other opensource libraries you would suggest that could get me 10ms tag reads? I mean I can read all the tags very fast, but reading the data in the tags is what takes 100ms is this normal?

What is on each end of this connection? IA Logix driver reading from pylogix PLC emulation?

How many tags are involved? How many requests are made to do the reads per desired update cycle?

(Typical request response times with a real L8x controllogix front port is 1 or 2 milliseconds. It doesn't take many requests to exceed your 10ms budget.

I created a Class1 I/O driver for Ignition because it is so hard to get very high speed very high volume data acquisition through a Class3 (TCP) connection.

Hi, on one end its pycomm3 logix Driver running in python on the other end is the actual PLC 1756-EN2T/D. Here is the wireshark packet capture. I am reading the data inside of 6 tags.

Capture

Can you post the actual pcap file?

Yes np. the plc is at 138.133.114.
PLC Capture2.pcapng (1.7 KB)
39

You might get a faster response if pycomm3 is able to read using instance IDs rather than tag names. But there is clearly a 100ms gap between request and response here, so it's not just a "Python is slow" problem.

EN2T is an ethernet module. What's the actual PLC? Are you on the same network or is this over a VPN connection or something?

oh yeh definitely over VPN. So I can read out the list of tags very quickly approx 45 tags in under 10ms. however reading the data inside is what takes long, however there is no noticeable difference between reading 1 tag or 6 tags this way,, its about 100ms.

You aren't going to get close to 10ms over VPN.

I'm not sure why listing the tags would be any faster - are you sure? Can you post a capture that includes that? Are you sure pycomm3 hasn't cached your browse data or something?

1 Like

I ran the tag read and it read 45 in .99ms is this read different than reading the actual values in the tags?

No, you only printed the value of a single tag in 0.99ms.
Your timing needs to be outside the loop to get the actual timing.

Nevermind - I read the code wrong.

I think you're actually getting an error there.

Your read line should be:

print(plc.read(*atomic*3))

(note the * that unpacks the list into varargs)

yeh I took that out because I am getting an error. So it seems that unpacking the list is what is causing the 100ms delay?

No, unpacking the list makes it so the library doesn't error out and the request is actually sent to the PLC!

You aren't doing anything but printing an error message that happens to contain the tag list you passed in, among other things. Your console isn't wrapping long lines so you just aren't seeing the error message.

Can you recommend a driver that supports UDP messaging? I dont think Pycomm3 does.

CIP messaging uses TCP port 44818. I don't think you can use UDP.

In Open Source, I only found this:

You could make an I/O target and have your PLC connect to it with generic ethernet device in the Studio 5000 I/O tree.

(That is essentially what you can do with my 3rd-party Ignition module's "Adapter" option.)