Compiling Altivar VFD Modbus comp

More
11 years 7 months ago #56647 by Swapper
Hi!
i have a problem getting the Altivar VFD Modbus comp to compile on my 2.8 system.

The things i have tried are:
downloaded files from:
git.mah.priv.at/gitweb?p=emc2-dev.git;a=...b0dd7283fe7496741167

Did a:
atv# make
The required program "comp" could not be found
The required program "comp" could not be found
Makefile:7: *** Required files for building components not present. Install emc2-dev. Stop.

Where can i find comp?

i asked in the linuxcnc channel and there is a thing called halcompile, apprently it does not support .c userland comps.
But i tried anyway..

atv# halcompile --compile --userspace atv_vfd.c
gcc -Os -g -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I/usr/include/i386-linux-gnu -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/usr/include/linuxcnc -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os -o atv_vfd /tmp/tmpUl75xA/atv_vfd.c -Wl,-rpath,/lib -L/lib -llinuxcnchal
/tmp/tmpUl75xA/atv_vfd.c: In function âmainâ:
/tmp/tmpUl75xA/atv_vfd.c:646:1: warning: the frame size of 4288 bytes is larger than 2560 bytes [-Wframe-larger-than=]
/tmp/ccg3lMd7.o: In function `write_data':
/tmp/tmpUl75xA/atv_vfd.c:233: undefined reference to `preset_single_register'
/tmp/tmpUl75xA/atv_vfd.c:234: undefined reference to `preset_single_register'
/tmp/ccg3lMd7.o: In function `read_data':
/tmp/tmpUl75xA/atv_vfd.c:295: undefined reference to `read_holding_registers'
/tmp/tmpUl75xA/atv_vfd.c:300: undefined reference to `read_holding_registers'
/tmp/tmpUl75xA/atv_vfd.c:305: undefined reference to `read_holding_registers'
/tmp/tmpUl75xA/atv_vfd.c:309: undefined reference to `read_holding_registers'
/tmp/tmpUl75xA/atv_vfd.c:314: undefined reference to `read_holding_registers'
/tmp/ccg3lMd7.o:/tmp/tmpUl75xA/atv_vfd.c:319: more undefined references to `read_holding_registers' follow
/tmp/ccg3lMd7.o: In function `main':
/tmp/tmpUl75xA/atv_vfd.c:515: undefined reference to `modbus_init_rtu'
/tmp/tmpUl75xA/atv_vfd.c:519: undefined reference to `modbus_connect'
/tmp/tmpUl75xA/atv_vfd.c:627: undefined reference to `preset_single_register'
/tmp/tmpUl75xA/atv_vfd.c:628: undefined reference to `preset_single_register'
/tmp/tmpUl75xA/atv_vfd.c:643: undefined reference to `modbus_close'
collect2: error: ld returned 1 exit status
make: *** [atv_vfd] Error 1

All help appreciated.
/Nils

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

More
11 years 7 months ago - 11 years 7 months ago #56655 by dgarrett
I experimetned with the files and got it too build run-in-place (no testing)
using the attached zipfile with some name (emc2-->linuxcnc) modifications
Code:
$ mkdir /tmp/tst # make a tst directory in /tmp $ # copiy the download of atv_vfd.zip to the /tmp/tst/ directory $ cd /tmp/tst $ unzip atv_vfd.zip $ cd atv_vfd $ source your_rip_root/scripts/rip-environment # real important ! $ make clean # clean any leftovers $ make # default is to show stuff from the find-* scripts $ make atv_vfd # compile -- no errors $ make install # install to rip bin dir (untested)

The code dates to 2011 and doesn't use libmodbus so it probably could use a lot of updates
Last edit: 11 years 7 months ago by dgarrett. Reason: attach zip file

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

More
11 years 7 months ago - 11 years 7 months ago #56675 by Swapper
Hi!
With the version and guidance you supplied i managed to compile the comp!
Thank you!

But when i load it and show the pins they show no values.
Or should it not show the values ?

The serial coms works since i have tested to poll values via "modpoll" software on the same machine on the same comport.
Code:
/bin# halrun halcmd: loadusr atv_vfd -d /dev/ttyACM0 -M -v halcmd: atv_vfd: device='/dev/ttyACM0', baud=19200, bits=8, parity='even', stopbits=1, address=1, verbose=0 Opening /dev/ttyACM0 at 19200 bauds (even) halcmd: show pin Component Pins: Owner Type Dir Value Name 5 bit OUT FALSE atv_vfd.at-speed 5 bit IN FALSE atv_vfd.enable 5 bit OUT FALSE atv_vfd.estop 5 bit IN FALSE atv_vfd.is-estop 5 float OUT 0 atv_vfd.main-volt 5 float OUT 0 atv_vfd.max-freq 5 float OUT 0 atv_vfd.min-freq 5 bit OUT FALSE atv_vfd.modbus-ok 5 float OUT 0 atv_vfd.motor-curr 5 float OUT 0 atv_vfd.motor-power 5 float OUT 0 atv_vfd.motor-volt 5 float OUT 0 atv_vfd.out-freq 5 float OUT 0 atv_vfd.out-rev 5 float OUT 0 atv_vfd.rat-mot-curr 5 float OUT 0 atv_vfd.rat-mot-rev 5 float OUT 0 atv_vfd.rat-mot-volt 5 float IN 0 atv_vfd.speed-command 5 bit IN FALSE atv_vfd.spindle-on 5 s32 OUT 0 atv_vfd.status 5 bit OUT FALSE atv_vfd.std-mot-freq halcmd:
Last edit: 11 years 7 months ago by Swapper.

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

More
11 years 7 months ago #56718 by andypugh

Swapper wrote: But when i load it and show the pins they show no values.


What happens if you try
setp atv_vfd.enable 1
?

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

More
11 years 7 months ago #57024 by Swapper
Nothing happens when i do that.
Is there any good way to debug and see what is being sent out and received?

Any other ideas?

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

More
11 years 7 months ago #57031 by Swapper
i tried running it and sniffing the serial port and its not putting out any data when i start it.

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

Time to create page: 0.109 seconds
Powered by Kunena Forum