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

Not able to access data stored in REAL type tag array. #12

Open
jaewing opened this issue Aug 28, 2023 · 2 comments
Open

Not able to access data stored in REAL type tag array. #12

jaewing opened this issue Aug 28, 2023 · 2 comments

Comments

@jaewing
Copy link

jaewing commented Aug 28, 2023

Hi all,

Looking for help to resolve the following issue that I have encountered. In Studio 5000 I am able to see that "Data_1" tag array exists and contains the value 69 at the index "1". The recommendation to "Ensure Encode Source Protected Content is disabled when saving L5X" I have been unable to follow because that option is check and grayed out in every menu I have found it. This could be an issue of me not understanding where to look to be able to disable this option, but have been unsuccessful in finding a solution so far.

Other research/feedback I have gotten is that if the content isn't protected, it shouldn't matter. I am not aware of how to determine if the content is protected or not as the guides I have found have been for much older RSLogix versions of the software. I am currently running v28.03.00 of Studio 5000.

To my best knowledge I have tried everything recommended on the README. Any support would be greatly appreciated!

image

Traceback (most recent call last): File "C:\Git\AP4-PowerNet-Test-Bench-Script\main.py", line 121, in <module> print(prj.controller.tags['Data_1'][1].value) ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^ File "C:\Users\jaewing\AppData\Local\anaconda3\envs\AP4_Test_Bench\Lib\site-packages\l5x\dom.py", line 294, in __getitem__ return self.create_value_object(element) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\jaewing\AppData\Local\anaconda3\envs\AP4_Test_Bench\Lib\site-packages\l5x\dom.py", line 304, in create_value_object return self.value_type(*args) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\jaewing\AppData\Local\anaconda3\envs\AP4_Test_Bench\Lib\site-packages\l5x\tag.py", line 100, in __init__ self.data = data_class(self.get_data_element(), self) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\jaewing\AppData\Local\anaconda3\envs\AP4_Test_Bench\Lib\site-packages\l5x\tag.py", line 112, in get_data_element raise RuntimeError("Decoded data content not found for {0} tag. " RuntimeError: Decoded data content not found for Data_1 tag. Ensure Encode Source Protected Content option is disabled when saving L5X.

@jvalenzuela
Copy link
Owner

jvalenzuela commented Aug 29, 2023

This is most likely caused by the size of the array. For some silly reason RSLogix will not export formatted data for tags that exceed some weird size limit; see issue #8. Ya, it's stupid.

I'm working on switching over to raw tag data, which is always present, instead of formatted to resolve this and other related issues.

@jaewing
Copy link
Author

jaewing commented Sep 5, 2023

Thank you @jvalenzuela for replying! Because of the info you provided I was able to determine the maximum single Tag Array sizes for REAL and INT. For INT tag array type, you can have a maximum dimension of 51200. For REAL you can have a maximum dimension of 27500. With those dimensions I was able to write/read to the tag arrays with my script. It is definitely odd to me that it lets you read/write to multiple INT tag arrays of 51200 in length but not to a single INT tag array longer than 51200. Very curious!

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