Debian stretch 64Bit b&r Acopos VFD trouble

More
09 May 2019 15:00 - 09 May 2019 15:09 #133245 by BigDo
hi all,

i had linuxcnc installed on a ubuntu Precise 32Bit system and compiled the VFD Modbus HAL component for my B&R AcoposInverter S44 derived from git.mah.priv.at/gitweb/emc2-dev.git/shor...ads/altivar-vfd-comp (btw this link is dead) from wiki.linuxcnc.org/cgi-bin/wiki.pl?VFD_Modbus under 32 bit has also worked well. Now I have the new stretch 64 bit installed and get an error message:
Found file (REL): ./custom.hal
Shutting down and cleaning up LinuxCNC ...
Killing task linuxcncsvr, PID = 6123
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments

Debug file information:
Note: Using POSIX realtime
./custom.hal:7: execv (BRacopos_vfd): Permission denied
./custom.hal:7: waitpid failed BRacopos_vfd spindle-vfd
./custom.hal:7: BRacopos_vfd exited without becoming ready
6123
  PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime

I think I have to recompile the component for the 64 bit system but I do not know what I have to change.
Can anyone help me with that?

I tried to compile it but:
cnc@cnc:~/BRacopos_vfd$ make BRacopos_vfd
Makefile:43: Warnung: Die Befehle fur das Ziel „install“ werden uberschrieben
/usr/share/linuxcnc/Makefile.modinc:104: Warnung: Alte Befehle fur das Ziel „install“ werden ignoriert
gcc -o BRacopos_vfd .o/BRacopos_vfd.o .o/modbus.o -Wl,-rpath,/usr/lib -L/usr/lib -llinuxcnchal -lglib-2.0
/usr/bin/ld: i386 architecture of input file `.o/BRacopos_vfd.o' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `.o/modbus.o' is incompatible with i386:x86-64 output
collect2: error: ld returned 1 exit status
Makefile:47: die Regel fur Ziel „BRacopos_vfd“ scheiterte
make: *** [BRacopos_vfd] Fehler 1

Niko

File Attachment:

File Name: BRacopos_vfd.zip
File Size:48 KB

File Attachment:

File Name: BRacopos_v...-05-09.c
File Size:23 KB

File Attachment:

File Name: modbus_2019-05-09.c
File Size:37 KB

File Attachment:

File Name: modbus_2019-05-09.h
File Size:6 KB

File Attachment:

File Name: Makefile.txt
File Size:2 KB

PS: By the way, the manufacturer of VFD of Bernecker + Rainer (B&R automation) probably Schneider Electric. Altivar VFD and AcoposInverter have the same menu structure
Attachments:
Last edit: 09 May 2019 15:09 by BigDo.

Please Log in or Create an account to join the conversation.

More
09 May 2019 18:06 #133263 by andypugh
I haven't looked in any detail at your files (or, in fact, at all)
But have you tried compiling and installing the .c file with halcompile?

Please Log in or Create an account to join the conversation.

More
11 May 2019 11:20 - 13 May 2019 09:54 #133443 by BigDo
thx for answer andy.

I have precompiled 32Bit BRacopos_vfd component in /usr/bin but if I start linuxcnc i get an error message:
Debug file information:
Note: Using POSIX realtime
./custom.hal:7: execv(BRacopos_vfd): No such file or directory
./custom.hal:7: waitpid failed BRacopos_vfd spindle-vfd
./custom.hal:7: BRacopos_vfd exited without becoming ready

can i in general use 32Bit scripts under linux 64Bit?

after some changes i tried
halcompile --compile --userspace BRacoposS44.c
halcompile --compile --userspace BRacoposS44.c
gcc -Os -g -I. -I/build/linuxcnc-2.7.14/src/include -DUSPACE -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/usr/include/linuxcnc -Wframe-larger-than=2560 -DSIM -fPIC -URTAPI -U__MODULE__ -DULAPI -Os  -o BRacoposS44 /tmp/tmpF0k_sg/BRacoposS44.c -Wl,-rpath,/lib -L/lib -llinuxcnchal 
/tmp/ccCQE6MZ.o: In function `windup':
/tmp/tmpF0k_sg/BRacoposS44.c:222: undefined reference to `modbus_strerror'
/tmp/ccCQE6MZ.o: In function `findkwd':
/tmp/tmpF0k_sg/BRacoposS44.c:271: undefined reference to `iniFind'
/tmp/ccCQE6MZ.o: In function `read_ini':
/tmp/tmpF0k_sg/BRacoposS44.c:304: undefined reference to `iniFindInt'
/tmp/tmpF0k_sg/BRacoposS44.c:306: undefined reference to `iniFindInt'
/tmp/tmpF0k_sg/BRacoposS44.c:307: undefined reference to `iniFindInt'
/tmp/tmpF0k_sg/BRacoposS44.c:308: undefined reference to `iniFindInt'
/tmp/tmpF0k_sg/BRacoposS44.c:309: undefined reference to `iniFindInt'
/tmp/ccCQE6MZ.o:/tmp/tmpF0k_sg/BRacoposS44.c:310: more undefined references to `iniFindInt' follow
/tmp/ccCQE6MZ.o: In function `read_ini':
/tmp/tmpF0k_sg/BRacoposS44.c:317: undefined reference to `iniFind'
/tmp/ccCQE6MZ.o: In function `write_data':
/tmp/tmpF0k_sg/BRacoposS44.c:362: undefined reference to `modbus_write_register'
/tmp/tmpF0k_sg/BRacoposS44.c:374: undefined reference to `round'
/tmp/tmpF0k_sg/BRacoposS44.c:375: undefined reference to `round'
/tmp/tmpF0k_sg/BRacoposS44.c:409: undefined reference to `modbus_write_register'
/tmp/tmpF0k_sg/BRacoposS44.c:430: undefined reference to `modbus_write_register'
/tmp/ccCQE6MZ.o: In function `read_initial':
/tmp/tmpF0k_sg/BRacoposS44.c:453: undefined reference to `modbus_read_registers'
/tmp/tmpF0k_sg/BRacoposS44.c:459: undefined reference to `modbus_read_registers'
/tmp/tmpF0k_sg/BRacoposS44.c:460: undefined reference to `modbus_read_registers'
/tmp/tmpF0k_sg/BRacoposS44.c:461: undefined reference to `modbus_read_registers'
/tmp/tmpF0k_sg/BRacoposS44.c:462: undefined reference to `modbus_read_registers'
/tmp/tmpF0k_sg/BRacoposS44.c:478: undefined reference to `modbus_strerror'
/tmp/ccCQE6MZ.o: In function `read_data':
/tmp/tmpF0k_sg/BRacoposS44.c:496: undefined reference to `modbus_read_registers'
/tmp/tmpF0k_sg/BRacoposS44.c:501: undefined reference to `modbus_read_registers'
/tmp/tmpF0k_sg/BRacoposS44.c:504: undefined reference to `modbus_read_registers'
/tmp/tmpF0k_sg/BRacoposS44.c:520: undefined reference to `modbus_read_registers'
/tmp/tmpF0k_sg/BRacoposS44.c:524: undefined reference to `modbus_read_registers'
/tmp/ccCQE6MZ.o:/tmp/tmpF0k_sg/BRacoposS44.c:527: more undefined references to `modbus_read_registers' follow
/tmp/ccCQE6MZ.o: In function `read_data':
/tmp/tmpF0k_sg/BRacoposS44.c:557: undefined reference to `modbus_strerror'
/tmp/ccCQE6MZ.o: In function `toggle_modbus_debug':
/tmp/tmpF0k_sg/BRacoposS44.c:233: undefined reference to `modbus_set_debug'
/tmp/ccCQE6MZ.o: In function `windup':
/tmp/tmpF0k_sg/BRacoposS44.c:227: undefined reference to `modbus_close'
/tmp/ccCQE6MZ.o: In function `main':
/tmp/tmpF0k_sg/BRacoposS44.c:720: undefined reference to `modbus_new_rtu'
/tmp/tmpF0k_sg/BRacoposS44.c:721: undefined reference to `modbus_strerror'
/tmp/tmpF0k_sg/BRacoposS44.c:726: undefined reference to `modbus_set_slave'
/tmp/tmpF0k_sg/BRacoposS44.c:730: undefined reference to `modbus_connect'
/tmp/tmpF0k_sg/BRacoposS44.c:731: undefined reference to `modbus_strerror'
/tmp/tmpF0k_sg/BRacoposS44.c:736: undefined reference to `modbus_set_debug'
/tmp/tmpF0k_sg/BRacoposS44.c:737: undefined reference to `modbus_set_slave'
/tmp/tmpF0k_sg/BRacoposS44.c:781: undefined reference to `modbus_flush'
/tmp/tmpF0k_sg/BRacoposS44.c:783: undefined reference to `modbus_write_register'
/tmp/tmpF0k_sg/BRacoposS44.c:785: undefined reference to `modbus_strerror'
/tmp/tmpF0k_sg/BRacoposS44.c:798: undefined reference to `modbus_flush'
/tmp/tmpF0k_sg/BRacoposS44.c:799: undefined reference to `modbus_close'
/tmp/tmpF0k_sg/BRacoposS44.c:803: undefined reference to `modbus_connect'
/tmp/tmpF0k_sg/BRacoposS44.c:807: undefined reference to `modbus_strerror'
collect2: error: ld returned 1 exit status
Makefile:2: die Regel für Ziel „BRacoposS44“ scheiterte
make: *** [BRacoposS44] Fehler 1

PS: after sudo apt-get install libmodbus-dev
the modbus header files were not in /usr/include where halcompile search for them but in /usr/include/modbus
Last edit: 13 May 2019 09:54 by BigDo.

Please Log in or Create an account to join the conversation.

More
15 May 2019 12:02 #133832 by andypugh
Yes, halcompile struggles a bit with C (or .comp) files with #INCLUDEs.

That same gcc command line with a -I... to the place where the modbus code can be found might be worth a try.

Please Log in or Create an account to join the conversation.

More
16 May 2019 16:59 - 17 May 2019 13:16 #133986 by BigDo
and finaly it works.

tested with b&r Acoposinverter S44 also should work with some Telemecanique/Schneider electric Altivar-vfd

File Attachment:

File Name: BRacopos_v...5-17.zip
File Size:59 KB



i have installed
linuxcnc-stretch-uspace-amd64.iso

btw: nice latency on Asus P5E3 Pro 8GB RAM Intenso SSD 120GB and Nvidia GTX 460 (with "isolcpus=2,3")
Servo thread(1ms): 2602
Base thread(25us); 14131
Attachments:
Last edit: 17 May 2019 13:16 by BigDo.

Please Log in or Create an account to join the conversation.

Time to create page: 0.097 seconds
Powered by Kunena Forum