Menu ▾ ▴

#21 Objdictedit generates wrong negative values in C code

v1.0 (example)
open
nobody
None
5
2013-08-13
2013-08-13
No

I have this entry in an .eds file of a stepper motor with CANopen interface:

[607Bsub1]
ParameterName=Min position range limit
ObjectType=0x7
DataType=0x0004
AccessType=rww
DefaultValue=-100000000
PDOMapping=1

The GUI of Objdictgen correctly shows the negative number, but the generated C source code eventually contains this line:

INTEGER32 Positionrangelimit_Minpositionrangelimit = 0x-5F5E100; / Mapped at index 0x607B, subindex 0x01 /

Such a line will be rejected by any C/C++ compiler due to the minus sign at the wrong position. Positive default values are converted correctly, only negative values are affected.

Discussion


Log in to post a comment.