Open ramezanifar opened 4 years ago
First, apologies for the long delay.
Short answer, you cannot read arrays with lists of tags.
Long answer: at some point I added the ability to provide the data type with with a single tag read or a list of tags to read. This helped improve performance for people that read a lot of unique tags because it eliminates getting the data type first. So when you attempt to do something like this:
tags = [('tag1[0]', 10), ('tag2[0]', 10)]
ret = comm.Read(tags)
I'm assuming that the 10 in those cases is the data type. It would then skip getting the data type, assuming that it was "10", and get the values for tag1[0] and tag2[0]. That is why you only get the first element.
I made some changes the other day to take advantage of the multi-service message object in order to bundle getting the data multiple data types into one packet. This speeds things up quite a bit for reading unique tags.
This doesn't help you though when trying to read lists of arrays. For now, only read non-arrays in lists, read arrays individually to get the best performance. I have functioning code to read arrays with lists, but I will have to figure out 2 things: Using multi-service messages (mulit-read) with arrays larger an a single packet, and what to do about people that are currently providing the data type to bypass discovering the data type. In other words, I'll probably have to make a change that would break compatibility in to accommodate this, which I don't like to do.
Preflight checks
Type of issue
Description of issue
Hello; I was trying to read/write multiple tags while tags are arrays. Example:
where array1 is SINT[100] and array2 is SINT[100]
Now if I read the tag list in one attempt, it returns only the first index of each array:
Is there a way to pass the length? I tried to sum up the length of all tags and use something like:
But still the same problem.
In addition to the read, I could not figure out multiple write when tags are array. Can you please give me a hint? Thank you in advance