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

Two (different) objects with the same name can be created but will not be exported in source code (legacy exporter) #55

Open
trojanobelix opened this issue May 12, 2023 · 1 comment
Assignees

Comments

@trojanobelix
Copy link
Collaborator

trojanobelix commented May 12, 2023

If there are two (different) objects with the same name only one will be created in sCO_OD_RAM
Without any error/warning.

Alternitives:

  1. It should create an ERROR message on export if not permitted (Compare with standard, EDS checker is fine with that)
  2. It should not be created if not permitted
  3. It could add an index on export (if it is permitted by the standard)

@CANopenNode : What do you think is best?

image

`/*2002 */
#define OD_2002_stringTest 0x2002

    #define OD_2002_0_stringTest_maxSubIndex                    0
    #define OD_2002_1_stringTest_subObject1                     1
    #define OD_2002_2_stringTest_subObject1                     2
    #define OD_2002_3_stringTest_subObject1                     3
    #define OD_2002_4_stringTest_subObject1                     4
    #define OD_2002_5_stringTest_subObject1                     5
    #define OD_2002_6_stringTest_subObject1                     6
    #define OD_2002_7_stringTest_subObject1                     7

/*******************************************************************************
STRUCTURES FOR VARIABLES IN DIFFERENT MEMORY LOCATIONS
*******************************************************************************/
#define CO_OD_FIRST_LAST_WORD 0x55 //Any value from 0x01 to 0xFE. If changed, EEPROM will be reinitialized.

/***** Structure for RAM variables ********************************************/
struct sCO_OD_RAM{
UNSIGNED32 FirstWord;

/*2000 */ VISIBLE_STRING stringTest[2];
/*2001 */ UNSIGNED32 newObject[5];

           UNSIGNED32     LastWord;

};`

@trojanobelix trojanobelix self-assigned this May 12, 2023
@trojanobelix trojanobelix changed the title Two (different) objects with the same name can be created but will not be exported in source code Two (different) objects with the same name can be created but will not be exported in source code (legacy exporter) May 15, 2023
@CANopenNode
Copy link
Owner

It seems it only happens in CANOPENNODE_LEGACY exporter. V4 exporter adds index to the variable name, so there is no problem. Maybe just add error message to LEGACY exporter.

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

No branches or pull requests

2 participants