Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - Reading multidimensional arrays #322

Open
disgustingBot opened this issue Jun 9, 2022 · 1 comment
Open

Feature - Reading multidimensional arrays #322

disgustingBot opened this issue Jun 9, 2022 · 1 comment

Comments

@disgustingBot
Copy link

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

@chrisbeardy
Copy link
Collaborator

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 chrisbeardy changed the title read by name on array requires double the dimension Feature - Reading multidimensional arrays Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants