Reading a big number of tags #51
Replies: 3 comments 2 replies
-
If you want to use the full symbolic addressing, the only possible option which may be faster is to use subscriptions. There you create a subscription with the variables you want the values from, and in what interval, and then the Plc sends you in this interval the values only when the value has changed, and once all values after creating the subscription. There is a CPU limit on how many subscriptions (different settings like interval) and how many variables you can add. This is the style WinCC reads variables. It want's to read all values with subscriptions, and when there aren't no more ressources, it switches to poll mode for the rest of the variables. I've added this basic functionality in Subscription.cs (with a simple poll loop which waits for the data), but I'm not 100% sure especially about the return values when something goes wrong. I've got many Wireshark logfiles from different firmware versions, and they behave different. As I've got only Plcsim for testing, this would need some tests on different real Plcs. But I'd guess no symbolic access method is faster than reading a complete datablock in absolute address mode. I haven't tested it for bigger absolute datablocks, but you can also read absolute addressed data with this driver, so someone should not need to enable Put/Get access in the Plc (but the Datablock has to be not optimized). |
Beta Was this translation helpful? Give feedback.
-
The limits for subscriptions are already read from the Plc on connection setup, and are in the class CommRessources. I haven't analyzed on how the SubscriptionMemory has to be respected, or how much memory each added tag to a subscription takes. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your answer, very informative.
This might be a good interim solution to allow older projects written with PUT/GET in mind to update without much hassle. At first I wasn't sure how to do it, but I think I've found a way, let me know if this is code is good, I've taken it for the most part from Program.cs in DriverTest project. With this method, it takes only 0.02 seconds to read from a PLCSIM Advanced, which is a great improvement.
One question I have is, what does this line do?
Thank you very much for your help, this is a spectacular project |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm testing the driver and I wanted to push the limits a bit and see if it could be used as a drop-in replacement in our solution. In a current project of ours we are using Sharp7 to read a non-optimized DB around 4KB long, around 20k tags. These tags are neatly organized into UDTs. We read this DB around once every second and log everything, then access the data knowing the offsets and all.
I was trying to see if we could achieve similar performance with this new driver using s7-comm-plus. Unfortunately, simply doing
_tags.ReadTags(conn)
it takes around 6-7 seconds using PLCSIM Advanced (I'm going to try on hardware as soon as I have some time).Is there any better/faster method to read lots of tags from the CPU? Maybe reducing the number of requests to the PLC and reading bigger chunks of memory. I don't know if WinCC can manage reading tens of thousands of tags a second tbh
Thank you very much for your work btw, it's extremely impressive
Beta Was this translation helpful? Give feedback.
All reactions