-
Notifications
You must be signed in to change notification settings - Fork 197
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
Object Dictionary does not get updated #520
Comments
You're right in your expectation about the OD getting updated. That's what a Now I think you might be looking at the wrong thing and therefore coming to wrong conclusions. The Now accessing local data through SDO is not wrong, as you might have thought. It basically just accesses the current cached data in the OD. There is no network overhead involved when calling this for a
There is a |
tag version 2.1.0.
All above method return an object which is the copy of the eds file and not the updated values.
I found correct data updated inside another object named node.datastore which is access by sdo methods.
What is missleading, is that inside the documentation https://canopen.readthedocs.io/en/latest/od.html, we may read:
The above code found in the library documentation does not work for local node as it's value is not updated by SDO The documentation should be updated. Regards |
I think you may be misunderstanding the docs here. The mentioned examples give you access to the What you want to achieve is basically a local data store of the objects' contents. That is not what the Object Dictionary implementation in this library does. But it is available by accessing the I guess you figured this out on your own, but somehow came to the conclusion that this would be the wrong way. As far as I can see, it is the intended and most useful way to access the data. Because all the logic of interpreting the raw byte content according to the OD description does not need to be duplicated when it's already handled in the SDO access classes. Of course, you can also use the callbacks-based functionality in |
I have a real CAN-network with one device connected. This device tries to interact with another node that I want to simulate by a LocalNode object, which workds fine. I created an object dictionary with one ODVariable with the particular index and subindex on which the real device tries to perform an SDO Download (e.g. 0x1F51, 0x01) and assigned it to the LocalNode object.
The SDO Download completes successfully what I can observe via candump. However, when I try to access the value via the object dictionary from the local node, I can't see the updated value but the default one from the initialization. The only way I can access the updated value is via "node.sdo[0x1F51].raw", which is an SdoVariable and not the original ODVariable. At this point, I can not provide any subindex and when a second ODVariable got assigned before with the same index but different subindex, I only can check the updated value from the most recently added Variable.
I don't know if I understand wrong the concept of the different variable classes, but my guess was that the object dictionary of the LocalNode gets updated when another Node performs SDO Downloads.
If not, how can I access an Variable with index and subindex?
The text was updated successfully, but these errors were encountered: