CANopenNode / CANopenEditor

CANopen Object Dictionary Editor
GNU General Public License v3.0
120 stars 60 forks source link

Errors when exporting to object dictionary #54

Closed spydatron closed 3 months ago

spydatron commented 1 year ago

Hi, When i import an eds file for the maxon epos4 controller and export the CANopenNode OD.h & OD.c, i receive the following errors:

Error in 0x1000: 'Count Label' must be 'NMT'
Error in 0x1001: 'Count Label' must be 'EM'
Error in 0x1005: 'Count Label' must be 'SYNC'
Error in 0x1010: 'Count Label' must be 'STORAGE'
Error in 0x1011: SubIndexes in ARRAY must be in sequence!
Error in 0x1014: 'Count Label' must be 'EM_PROD'
Error in 0x1016: 'Count Label' must be 'HB_CONS'
Error in 0x1017: 'Count Label' must be 'HB_PROD'
Error in 0x1200: 'Count Label' must be 'SDO_SRV'
Error in 0x1400: 'Count Label' must be 'RPDO'
Error in 0x1401: 'Count Label' must be 'RPDO'
Error in 0x1402: 'Count Label' must be 'RPDO'
Error in 0x1403: 'Count Label' must be 'RPDO'
Error in 0x1800: 'Count Label' must be 'TPDO'
Error in 0x1801: 'Count Label' must be 'TPDO'
Error in 0x1802: 'Count Label' must be 'TPDO'
Error in 0x1803: 'Count Label' must be 'TPDO'
Error in 0x3000: Default value must be defined on all ARRAY elements or must be undefined on all ARRAY elements!
Error in 0x3000: Attributes of elements in ARRAY must be equal
Error in 0x3000: Default value must be defined on all ARRAY elements or must be undefined on all ARRAY elements!
Error in 0x3000: Attributes of elements in ARRAY must be equal
Error in 0x301A: Default value must be defined on all ARRAY elements or must be undefined on all ARRAY elements!
Error in 0x301A: Attributes of elements in ARRAY must be equal
Error in 0x3141: Default value must be defined on all ARRAY elements or must be undefined on all ARRAY elements!
Error in 0x3141: Attributes of elements in ARRAY must be equal
Error in 0x3150: Default value must be defined on all ARRAY elements or must be undefined on all ARRAY elements!
Error in 0x3150: Attributes of elements in ARRAY must be equal
Error in 0x31E4: Default value must be defined on all ARRAY elements or must be undefined on all ARRAY elements!
Error in 0x31E4: Attributes of elements in ARRAY must be equal
Error in 0x3248: Default value must be defined on all ARRAY elements or must be undefined on all ARRAY elements!
Error in 0x3248: Attributes of elements in ARRAY must be equal
Error in 0x60E5: SubIndexes in ARRAY must be in sequence!
Error in 0x60E5: SubIndexes in ARRAY must be in sequence!
Error in 0x60E5: SubIndexes in ARRAY must be in sequence!

What could be the problem and how can i fix it?

spydatron commented 1 year ago

This is the eds file: SEE maxxon.eds.txt TWO POST LATER

trojanobelix commented 1 year ago

Please attach files directly! What Version do you use?

trojanobelix commented 1 year ago

maxxon.eds.txt

For the countlables I have to dig a little deeper

@CANopenNode Can you give me a hint for the other wrnings? Do we need these Warnings in the CanOpenExporter? There is nothing in the CiA 306 definition for EDS files that justifies these warnings! The EDSchecker from Vector would also check this object as error-free!

if (data.cType != dataElem.cType || data.length != dataElem.length) Warnings.AddWarning($"Error in 0x{indexH}: Data type of elements in ARRAY must be equal!", Warnings.warning_class.WARNING_BUILD); if ((data.cValue == null && dataElem.cValue != null) || (data.cValue != null && dataElem.cValue == null)) Warnings.AddWarning($"Error in 0x{indexH}: Default value must be defined on all ARRAY elements or must be undefined on all ARRAY elements!", Warnings.warning_class.WARNING_BUILD); if (attr != attrElem) Warnings.AddWarning($"Error in 0x{indexH}: Attributes of elements in ARRAY must be equal", Warnings.warning_class.WARNING_BUILD);

Robotae commented 1 year ago

I've had a similar issue with generating .[ch] files from an .eds file. I believe it's caused by commit 5b7f3f5 from 16th March 2023. This requires the user to provide correct count labels; fine if you're using a .xpd file but no good for .eds files as they don't contain count labels. This can be demonstrated by opening DS301_profile.xpd from the EDSEditorGUI/Profiles directory, export the .[ch] files (File->Export CanOpenNode...), export as an .eds file (File->Export...), closing the .xpd file, opening the .eds file and exporting the .[ch] files. OD.h exported from the .xpd file contains all the ODCNT* defines in the "Counters of OD objects" section but OD.h exported from the .eds file contains none of these. I'm using EDSSharp on the command line to generate .[ch] files from an .eds file. How about adding an option to EDSSharp (and EDSEditor) to automatically add count labels if they're missing, as it used to do, so these tools can be used with .eds files again?

CANopenNode commented 9 months ago

If you import eds file, there is no information about CANopenNode specific parameters. Also have to follow rules described here: https://github.com/CANopenNode/CANopenNode/blob/master/doc/objectDictionary.md

Or use communication objects from DS301_profile.xpd

trojanobelix commented 3 months ago

Closed: No feedback