CANopenNode / CANopenEditor

CANopen Object Dictionary Editor
GNU General Public License v3.0
142 stars 64 forks source link

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

Open trojanobelix opened 1 year ago

trojanobelix commented 1 year ago

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;

};`

CANopenNode commented 1 year ago

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.