-
Notifications
You must be signed in to change notification settings - Fork 88
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] - Radix support when reading tag values #287
Comments
This may be possible to reverse engineer, but I have not tried it. Attribute 6 of the Symbol object may be one possible location for it, according to this Micro800 doc it's called software control and it is 32 bits for whatever. I was able to figure out that bit 26 indicated if a tag was an alias to another or not, but that's as far as I went. If it's stored in that, should be able brute force a bunch of tags and see if there is a pattern. As for formatting the value, yeah that's probably possible. Since radix only determines how the value is displayed, I think implementing it as part of the |
Hmm, I'll take a look today and see what I can find. I think implementing it in |
OK, you are correct, it is in software control (attr 6). I will work on decoding which bits to what it means. |
OK, on RSLogix 5000 v20 (I don't have anything newer at home to test with) here are the values for the supported radix. (These are the only radix that RSLogix 5000 v20 has in the drop downs.
Other values may be used in newer versions of studio, I imagine there may be values used for unsigned datatypes. When I get back to work next week I will do some testing on v35 and see what other radix are supported.
I definitely needed more coffee. I was looking at bits 28-31. I corrected it above. |
Oh that's awesome, thanks for getting that so fast. |
No problem. I am more than happy to do testing once your ready. |
A radix value of 0x0 is used for some built-in types like timers to indicate a null radix. |
I added initial support based on what we know currently, you can try it out on the tag = plc.read('some_tag')
formatted_tag = format_tag(tag.value, plc.tags[tag.tag]['radix']) In this fabled rewrite I've been working on, I've created custom objects for all of the CIP data types and it would be much easier to override their We could add it as a property to the |
I think that would be fine for now. I have not yet figured out where the radix for struct members is stored. Currently I'm looking for that, along with the external access information for struct members. (I would also love to know where the tag descriptions are stored for v21 and above, but I won't be able to test anything until I get back to work and have access to L7x and L8xE controllers) Also, unrelated to the radix, I am also grabbing if a tag is flagged as constant right now. It is nice to know so that I do not accidently try to write to a constant tag, and I can display to the user that a tag is a constant. Attribute 11 of the symbol class stored as an SINT where 0 is not a constant and 1 is a constant. That may perhaps be another useful piece of information to grab in the future. |
OK, I've made progress with structs. Still confused on some parts of it, and it is not the same as tags, but I do know how to get the radix. The radix info is only stored on user created types, and is in the extra payload at the end of the template name pycomm3/pycomm3/logix_driver.py Line 780 in f3c41eb
So the payload of the info is after the semicolon. In each 32bit entry, the lowest 4 bits are the radix.
I hope I explained that OK, if you have questions, please let me know. Interestingly, external access settings for the members are not stored here (I figured they would be). Still on the hunt for them. |
Type of Feature Request
Feature Description
I was wondering if it would be possible to get the radix for a symbol from the controller, and perhaps auto format the read values into that radix (maybe like a getter that auto formats the value to a string in the correct radix, or a getter that returns the radix so the developer can format the value correctly)
Possible Solution
Not sure, I took a look at ADF file
cip107r07v01.ADF
and nothing stood out to me as to if the radix was stored there. I will do some testing later to confirm. Do you know if the radix is stored in the controller and where that might be?Thanks,
Trevor
The text was updated successfully, but these errors were encountered: