I was wondering about what is the best way to read large block of data from a plc, in my case Siemens s7-1500 (using integrated OPCUA Server).
I have an UDT definition on my PLC looking something similar to this :
MyUdt: Id --> int Name --> String(20) Code --> String(20) p1 --> Int p2 --> Int p3 --> long p4 --> bool p5 -->bool
The above UDT is instantiated 50 times in lets say DB5.
DB5 starting from byte 0 has inside 50 UDT, not inside an array, just single UDT one after the other like this :
DB5 : MyUdt_1 MyUdt_2 MyUdt_3 ... MyUdt_50
It happens that I need to read all of them, to perform some logic and then write them back.
At the moment, in order to perform a read action, I prepare my array of single tags,
then i call the system.opc.readValues and i have, after few seconds, the values i was looking for.
I need to perform an OPC direct read as I can’t manage to subscribe to this tags, otherwise I will saturate the s7 Opcua Server.
I remember using opensource DotNet DLLs to interact with Siemens PLC, and i was able to perform a block read lets say from DB5 byte 0 - 20000, and then when i had that array of bytes , i had to parse them to recreate the desiderate structure of data.
From my understanding, this reading method should be more efficient.
Correct me if I’m wrong, but event if i send a system.opc.readValues instead of the system.opc.readValue, the request to the PLC is only one, but still the cpu has to search for every single tag i requested.(And i don’t find a way to register this Nodes on the Siemens OPCUA Server : Registered reading of OPCUA server)
Is there any way, and if there is could you point me at some docs, to accomplish the same task?
My aim is to read the DB5 data as quick as I possibly do, and give to Ignition the task to parse the data.
Thank you for your time