Skip to content

Performance issue with ReadTags (Slow Reading) #62

@SimoneMaffei98

Description

@SimoneMaffei98

Good morning,
I’m using this library to read variables from a Siemens S7-1513 PLC with firmware version 2.9.
There are about 11,000 variables to read. It’s not an excessive amount, but when I try to read all of them at once using the ReadTags function, the execution takes more than 3 seconds, which is unacceptable considering the expected time should be around 10 ms.

After further investigation, I found that the issue seems to be within the SendS7plusFunctionObject and WaitForNewS7plusReceived functions, which are internally called by ReadValues. Each call takes around 20–30 ms, and since the function splits the read requests into chunks of 100 variables, it's invoked approximately 110 times.

Is it possible to send a single request to retrieve all values at once?

Using Wireshark, I compared the network traffic with another similar application that seems to use the same functions. While we are sending multiple requests to read the 11,000 variables, the other application appears to send a single request and then receives the data in around fifty consecutive packets in just around 15ms. Unfortunately, I couldn’t analyze the content further since the communication was encrypted.

Is it possible to achieve a similar behavior using this library?

Thank you very much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions