Skip to content

Conversation

ckhardin
Copy link

The count label is required to compile against the CANopenNode v4 library since the definitions are checked by code like the following in CANopen.c

    #if OD_CNT_NMT != 1
     #error OD_CNT_NMT from OD.h not correct!
    #endif

This problem is exhibited when there is no xpd file that has the custom properties and there is only an EDS file available. The StorageLocation is an example of setting the custom property for the CO_storageGroup and this is adding a similar extension for the CO_countLabel.

An example eds for NMT 0x1000 is shown below

    [1000]
    ParameterName=Device type
    ObjectType=0x7
    ;CountLabel=NMT
    ;StorageLocation=ROM
    DataType=0x0007
    AccessType=ro
    DefaultValue=0x00000000
    PDOMapping=0

@ckhardin
Copy link
Author

ckhardin commented Mar 26, 2025

@nimrof - this might not be the patch if the actual expectation is that everything is supposed to be an xdd file and that is what is used to generate the CANopenNodeV4 export since the additional property support is in that it seems.

without this - then we end up with the warnings in an EDS to CANopenNodeV4 - there might be other problems coming later as well - so, should this EDS to V4 just not be supported? or should it get fixes?

WARNING :Error in 0x1000: 'Count Label' must be 'NMT'
WARNING :Error in 0x1001: 'Count Label' must be 'EM'
WARNING :Error in 0x1005: 'Count Label' must be 'SYNC'
WARNING :Error in 0x1006: 'Count Label' must be 'SYNC_PROD'
WARNING :Error in 0x1010: 'Count Label' must be 'STORAGE'
WARNING :Error in 0x1012: 'Count Label' must be 'TIME'
WARNING :Error in 0x1014: 'Count Label' must be 'EM_PROD'
WARNING :Error in 0x1016: 'Count Label' must be 'HB_CONS'
WARNING :Error in 0x1017: 'Count Label' must be 'HB_PROD'
WARNING :Error in 0x1200: 'Count Label' must be 'SDO_SRV'
WARNING :Error in 0x1400: 'Count Label' must be 'RPDO'
WARNING :Error in 0x1401: 'Count Label' must be 'RPDO'
WARNING :Error in 0x1402: 'Count Label' must be 'RPDO'
WARNING :Error in 0x1403: 'Count Label' must be 'RPDO'
WARNING :Error in 0x1800: 'Count Label' must be 'TPDO'
WARNING :Error in 0x1801: 'Count Label' must be 'TPDO'
WARNING :Error in 0x1802: 'Count Label' must be 'TPDO'
WARNING :Error in 0x1803: 'Count Label' must be 'TPDO'

And the real problem is that it does not build

modules/lib/canopennode/CANopen.c:48:3: error: #error OD_CNT_NMT from OD.h not correct!
   48 |  #error OD_CNT_NMT from OD.h not correct!
      |   ^~~~~

@nimrof nimrof self-requested a review April 17, 2025 15:04
Copy link
Collaborator

@nimrof nimrof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
Thanks for the pr. I see the need and pr. looks good.
Just one little change i want and that is to check if there is a label before writing it to the file.

Sorry for the long review delay

@ckhardin ckhardin force-pushed the ckhardin/add-countlabel-eds-extension branch from 1d5bbb7 to 8b2ff47 Compare April 17, 2025 17:44
@ckhardin ckhardin requested a review from nimrof April 17, 2025 17:44
The count label is required to compile against the CANopenNode v4
library since the definitions are checked by code like the following
in CANopen.c

    #if OD_CNT_NMT != 1
     #error OD_CNT_NMT from OD.h not correct!
    #endif

This problem is exhibited when there is no xpd file that has the
custom properties and there is only an EDS file available. The
StorageLocation is an example of setting the custom property for
the CO_storageGroup and this is adding a similar extension for
the CO_countLabel.

An example eds for NMT 0x1000 is shown below
    [1000]
    ParameterName=Device type
    ObjectType=0x7
    ;CountLabel=NMT
    ;StorageLocation=ROM
    DataType=0x0007
    AccessType=ro
    DefaultValue=0x00000000
    PDOMapping=0

Signed-off-by: Charles Hardin <[email protected]>
@ckhardin ckhardin force-pushed the ckhardin/add-countlabel-eds-extension branch from 8b2ff47 to 7937b10 Compare April 17, 2025 17:46
@CANopenNode
Copy link
Owner

this might not be the patch if the actual expectation is that everything is supposed to be an xdd file and that is what is used to generate the CANopenNodeV4 export since the additional property support is in that it seems.

When I was integrating V4, i put all my efforts into xdd and tried to touch other in minimum. Xdd was meant to be a project file, eds only for export.

But eds could also contain some custom properties and could also be used as a project file. I agree with the PR. Maybe there could be an option in exporter, similar as for xdd: export full eds or export stripped eds without custom properties.

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

Successfully merging this pull request may close these issues.

3 participants