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

Does the dictionary in the EDS file have any impact on uppercase or lowercase names? #391

Open
zouzhe1 opened this issue Aug 19, 2023 · 4 comments

Comments

@zouzhe1
Copy link

zouzhe1 commented Aug 19, 2023

I don't think it's appropriate to find a corresponding dictionary by name,
because different manufacturers' dictionaries have different names, such as uppercase and lowercase。
For example, one of my devices is ['actual speed '], but your routine is ['Velocity actual value']

I think you should use the cia standard to represent it, such as 6040,1008,6060 and so on, in numerical form.

Also, using strings to represent NMT status is not safe, although it may seem intuitive. Due to the possibility of accidentally typing another character, the NMT status may be incorrect. For example, node. state='READY TO SWITCH ON', this string is easy to write as 'READY TO SWITCH ON'

@acolomb
Copy link
Collaborator

acolomb commented Aug 19, 2023

So what exactly are you proposing to change?

@zouzhe1
Copy link
Author

zouzhe1 commented Aug 19, 2023

@acolomb Using variables or macro definitions, or enumerations, to replace strings

@acolomb
Copy link
Collaborator

acolomb commented Aug 19, 2023

Okay, but where exactly?

Macros don't exist in python as they do in C for example. Enumerations neither. In Python, every symbol is just a pointer to an object. Any object has a hash, which is used when looking up keys in a map.

@friederschueler
Copy link
Collaborator

Also you could jsut use the hex values to access sdo if you don't wanna use strings:

node.sdo[0x1000].raw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants