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

PDOMapping in EDS file does not check for ValueError Exception #385

Open
Obsnold opened this issue Jul 7, 2023 · 0 comments
Open

PDOMapping in EDS file does not check for ValueError Exception #385

Obsnold opened this issue Jul 7, 2023 · 0 comments

Comments

@Obsnold
Copy link

Obsnold commented Jul 7, 2023

I've just encountered some EDS files that have the PDOMapping value with no value after the = sign e.g.

[3020sub0]
ParameterName=Number of entries
ObjectType=0x07
DataType=0x0005
AccessType=ro
DefaultValue=0x9
PDOMapping=

when I try to load the file it throws the error:

ValueError: invalid literal for int() with base 0: ''

At first I though the EDS file had been corrupted or generated incorrectly( it states it was made with CANopen Design Tool 2.2.34).

Also it only seems to happen on SubIndex 0.

I double checked the spec CiA 306 version 1.3.0 and noticed this about arrays:

the entry PDOMapping for all sub-indexes except 0 and 255 is given by the entry PDOMapping of the main object. sub-index 0 is assumed not to be mappable

so that's why I'm guessing the tool though it was ok to leave it blank.

I saw that the library handled the same situation for other values (DefaultValue seem to have the same issue a lot) , so I'' create a pull request to handle it in the same way for PDOMapping.

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

2 participants