cia402.comp - can't compile in 2.10-pre2

More
3 days 13 hours ago #350490 by tuxcnc
I am using a file from github.com/rodw-au/cia402_homecomp/blob/main/cia402.comp .
It has always compiled successfully for me in the past, and it has nothing to do with the internal homing routines of the drives.
I am attempting to transition from LinuxCNC 2.10-pre1 to 2.10-pre2.
I have managed to resolve a few issues, but I have no idea why `cia402.comp` refuses to compile.
The full output is:
Code:
root@HP-15:~/Pobrane# halcompile --install cia402.comp  cia402.comp:97: Warning: Old type 'unsigned' was replaced by 'ui32', but you should be upgrading to 'uint'. cia402.comp:98: Warning: Old type 'signed' was replaced by 'si32', but you should be upgrading to 'sint'. cia402.comp:99: Warning: Old type 'signed' was replaced by 'si32', but you should be upgrading to 'sint'. cia402.comp:100: Warning: Old type 'signed' was replaced by 'si32', but you should be upgrading to 'sint'. cia402.comp:102: Warning: Old type 'unsigned' was replaced by 'ui32', but you should be upgrading to 'uint'. cia402.comp:103: Warning: Old type 'signed' was replaced by 'si32', but you should be upgrading to 'sint'. cia402.comp:104: Warning: Old type 'signed' was replaced by 'si32', but you should be upgrading to 'sint'. cia402.comp:105: Warning: Old type 'signed' was replaced by 'si32', but you should be upgrading to 'sint'. cia402.comp:108: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:109: Warning: Old type 'float' has been replaced by 'real' cia402.comp:110: Warning: Old type 'float' has been replaced by 'real' cia402.comp:112: Warning: Old type 'float' has been replaced by 'real' cia402.comp:113: Warning: Old type 'float' has been replaced by 'real' cia402.comp:114: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:117: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:118: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:119: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:121: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:122: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:123: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:124: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:125: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:126: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:127: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:128: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:129: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:130: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:131: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:132: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:133: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:134: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:136: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:139: Warning: Old type 'float' has been replaced by 'real' cia402.comp:140: Warning: Old type 'float' has been replaced by 'real' cia402.comp:141: Warning: Old type 'bit' has been replaced by 'bool' cia402.comp:142: Warning: Old type 'bit' has been replaced by 'bool' Compiling realtime cia402.c cia402.comp: In function ‘extra_setup’: cia402.comp:173:13: error: lvalue required as left operand of assignment cia402.comp:176:14: error: lvalue required as left operand of assignment cia402.comp:179:20: error: lvalue required as left operand of assignment cia402.comp:180:12: error: lvalue required as left operand of assignment cia402.c:313:86: warning: unused parameter ‘prefix’ [-Wunused-parameter]   313 | #define EXTRA_SETUP() static int extra_setup(struct __comp_state *__comp_inst, char *prefix, long extra_arg)       |                                                                                ~~~~~~^~~~~~ cia402.comp:171:1: note: in expansion of macro ‘EXTRA_SETUP’ cia402.c:313:99: warning: unused parameter ‘extra_arg’ [-Wunused-parameter]   313 | #define EXTRA_SETUP() static int extra_setup(struct __comp_state *__comp_inst, char *prefix, long extra_arg)       |                                                                                              ~~~~~^~~~~~~~~ cia402.comp:171:1: note: in expansion of macro ‘EXTRA_SETUP’ cia402.comp: At top level: cia402.comp:185:19: error: unknown type name ‘hal_float_t’; did you mean ‘hal_port_t’? cia402.comp: In function ‘read_all’: cia402.comp:203:3: error: implicit declaration of function ‘check_scales’ [-Wimplicit-function-declaration] cia402.comp:203:16: error: lvalue required as unary ‘&’ operand cia402.comp:204:16: error: lvalue required as unary ‘&’ operand cia402.comp:207:10: error: lvalue required as left operand of assignment cia402.comp:210:15: error: lvalue required as left operand of assignment cia402.comp:213:18: error: lvalue required as left operand of assignment cia402.comp:214:17: error: lvalue required as left operand of assignment cia402.comp:215:26: error: lvalue required as left operand of assignment cia402.comp:216:26: error: lvalue required as left operand of assignment cia402.comp:219:26: error: lvalue required as left operand of assignment cia402.comp:220:26: error: lvalue required as left operand of assignment cia402.comp:221:26: error: lvalue required as left operand of assignment cia402.comp:222:26: error: lvalue required as left operand of assignment cia402.comp:223:26: error: lvalue required as left operand of assignment cia402.comp:224:26: error: lvalue required as left operand of assignment cia402.comp:225:26: error: lvalue required as left operand of assignment cia402.comp:226:26: error: lvalue required as left operand of assignment cia402.comp:227:26: error: lvalue required as left operand of assignment cia402.comp:230:25: error: lvalue required as left operand of assignment cia402.comp:232:27: error: lvalue required as left operand of assignment cia402.comp:239:18: error: lvalue required as left operand of assignment cia402.comp:240:19: error: lvalue required as left operand of assignment cia402.comp:246:15: error: lvalue required as left operand of assignment cia402.comp:248:15: error: lvalue required as left operand of assignment cia402.comp: In function ‘write_all’: cia402.comp:266:15: error: lvalue required as left operand of assignment cia402.comp:268:10: error: lvalue required as left operand of assignment cia402.comp:270:19: error: lvalue required as left operand of assignment cia402.comp:274:19: error: lvalue required as left operand of assignment cia402.comp:278:19: error: lvalue required as left operand of assignment cia402.comp:280:21: error: lvalue required as left operand of assignment cia402.comp:282:23: error: lvalue required as left operand of assignment cia402.comp:289:23: error: lvalue required as left operand of assignment cia402.comp:291:23: error: lvalue required as left operand of assignment cia402.comp:295:10: error: lvalue required as left operand of assignment cia402.comp:302:12: error: lvalue required as left operand of assignment cia402.comp:306:12: error: lvalue required as left operand of assignment cia402.comp:310:12: error: lvalue required as left operand of assignment cia402.comp:313:19: error: lvalue required as left operand of assignment cia402.c:311:80: warning: unused parameter ‘period’ [-Wunused-parameter]   311 | #define FUNCTION(name) static void name(struct __comp_state *__comp_inst, long period)       |                                                                           ~~~~~^~~~~~ cia402.comp:252:1: note: in expansion of macro ‘FUNCTION’ make: *** [/usr/share/linuxcnc/Makefile.modinc:117: cia402.o] Błąd 1 root@HP-15:~/Pobrane# 
The initial lines regarding the replacement of old variable types with new ones seem fine, but the parts referring to lines 139 and 140 of the `cia402.comp` file look suspicious to me.
It appears that the declarations on lines 139 and 140 are incorrect; this is likely the source of all those error messages stating that a floating-point constant cannot be assigned to variables whose types the compiler fails to recognize.
I could be wrong, but I don’t see any other likely culprits.
Additionally, there might be a type conflict further down in the code, as `hal_real` in C corresponds to `double` rather than `float`.
In any case, this problem is beyond my capabilities, and without `CIA402.so`, my machine simply won't work...

Please Log in to join the conversation.

More
3 days 2 hours ago #350501 by grandixximo
a compatible cia402 is released with the latest linuxcnc-ethercat you don't need to compile it yourself, I also rewritten it in C.

github.com/linuxcnc-ethercat/linuxcnc-et...releases/tag/v1.47.0

here is the fixed component in C if you want to take a look

github.com/linuxcnc-ethercat/linuxcnc-et.../master/src/cia402.c

---
test signature

Please Log in to join the conversation.

More
3 days 1 hour ago #350506 by rodw

a compatible cia402 is released with the latest linuxcnc-ethercat you don't need to compile it yourself, I also rewritten it in C.

github.com/linuxcnc-ethercat/linuxcnc-et...releases/tag/v1.47.0

here is the fixed component in C if you want to take a look

github.com/linuxcnc-ethercat/linuxcnc-et.../master/src/cia402.c
Great work. I assume this is only for 2.10 or does it also work for 2.9?
Also, Dominic's original component did not support homing with switches attached to the drive (just encoders). Has this component included limit switch homing support (probably linking to a homecomp)

Please Log in to join the conversation.

More
3 days 1 hour ago #350508 by grandixximo

Great work. I assume this is only for 2.10 or does it also work for 2.9?
Also, Dominic's original component did not support homing with switches attached to the drive (just encoders). Has this component included limit switch homing support (probably linking to a homecomp)

Both LinuxCNC 2.9.x and 2.10 are supported. The v1.47.0 release provides plain packages for 2.9.x and +getset packages for 2.10.0~pre2 and later. The component uses a compatibility layer for the old and new HAL APIs, while keeping the original pin and parameter names, so existing loadrt cia402 ... configurations should carry over.

On homing: your custom homecomp handles LinuxCNC-side homing integration and is not part of CiA 402, so it remains separate from the generic cia402 component. This release only ports Dominik's component to C. It still triggers and monitors drive-internal homing; the selected CiA 402 homing method, including methods using switches connected to the drive, is configured in the drive. No homecomp functionality has been added.

---
test signature

Please Log in to join the conversation.

More
2 days 15 hours ago #350513 by tuxcnc

a compatible cia402 is released with the latest linuxcnc-ethercat you don't need to compile it yourself, I also rewritten it in C.

github.com/linuxcnc-ethercat/linuxcnc-et...releases/tag/v1.47.0

here is the fixed component in C if you want to take a look

github.com/linuxcnc-ethercat/linuxcnc-et.../master/src/cia402.c
 
I couldn't have known about this, as I didn't examine the source files; I simply used the pre-built package you provided a link to. It doesn't work and instead throws the following error:
Code:
lcec_conf: /lib/x86_64-linux-gnu/libethercat.so.1: version `LIBETHERCAT_1.6.13' not found (required by lcec_conf)
The `libethercat_1.6.13.g61cc654-1+41.1_amd64.deb` package contains a file named `libethercat.so.1.2.0`, which includes the strings `LIBETHERCAT_1.6` rather than `LIBETHERCAT_1.6.13`—this is likely the cause of the error.

On the other hand, `linuxcnc-ethercat_1.45.0+getset-1+deb12u1_amd64.deb` works, but it does not contain `cia402.so`.
Consequently, I installed version 1.45 and used the `cia402.so` file extracted from the 1.47 package.
The machine works now.

Thank for your works.

 

Attachment not found


 

Please Log in to join the conversation.

Time to create page: 0.147 seconds
Powered by Kunena Forum