You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scenario:
I have an array in PLC with the shape 4x12, trying to read from python reads as a flatten 1d array (that seems a wee bit odd, but is ok enough). The problem is, if I do conn.read_by_name('variable', data_type*48) I get an array where every other value (even indexes) is 0, and the rest (odd indexes) are the values expected to read (hence having half the array). So I have to actually try to read 96 values and ignore all the zeros.
Is not that bad, because there is a workaround (just read more values) but I still wanted to report, maybe it helps.
All in all, the library works like a charm and I am very grateful to all of the contributors. Thanks a lot
The text was updated successfully, but these errors were encountered:
reading multidimensional arrays is not currently supported. I expected that it would come back as a 1d array but the every other values as a zero is an odd one.
Reading arrays of arrays (var : ARRAY [0..3] OF ARRAY [0..11] OF LREAL ) comes back slightly nicer but still isn't great.
Reading multidimensional arrays properly is on the wish list, but thanks for letting us know.
chrisbeardy
changed the title
read by name on array requires double the dimension
Feature - Reading multidimensional arrays
Mar 27, 2024
setup:
TwinCat 3, pyads version: 3.3.7.
scenario:
I have an array in PLC with the shape 4x12, trying to read from python reads as a flatten 1d array (that seems a wee bit odd, but is ok enough). The problem is, if I do conn.read_by_name('variable', data_type*48) I get an array where every other value (even indexes) is 0, and the rest (odd indexes) are the values expected to read (hence having half the array). So I have to actually try to read 96 values and ignore all the zeros.
Is not that bad, because there is a workaround (just read more values) but I still wanted to report, maybe it helps.
All in all, the library works like a charm and I am very grateful to all of the contributors. Thanks a lot
The text was updated successfully, but these errors were encountered: