- Posts: 20
- Thank you received: 0
Compiling Altivar VFD Modbus comp
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 to join the conversation.
using the attached zipfile with some name (emc2-->linuxcnc) modifications
The code dates to 2011 and doesn't use libmodbus so it probably could use a lot of updates
Please Log in to join the conversation.
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.
Please Log in to join the conversation.
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 to join the conversation.
Is there any good way to debug and see what is being sent out and received?
Any other ideas?
Please Log in to join the conversation.
Please Log in to join the conversation.
Swapper wrote: i tried running it and sniffing the serial port and its not putting out any data when i start it.
If you send other data to ttyACM0 do you see serial port activity?
Please Log in to join the conversation.
I wrote this program many years ago. Before EMC renames to LINUXCNC.
I had many problems with comunication because only one (from 3) conveter rs232 to rs485 was functional.
I had no success with convert USB to rs485.
At first you can try comercial soft powersuite for ATV to test raw comunication.
I suppose you have setup vfd for modbus comunication. It is describes in file popis.
setup VFD for modbus communication
Drive menu
communication 1.9
modbus network - adress 1
baud rate 38.4
format 8-E-1
command 1.6
ref.1 chanel - modbus
stop key priority - yes
profile - Not separ
ref.2 switching - ch1 active
ref.2 chanel - HMI (Graphic Terminal)
copy channel 1<>2- cmd+ref
F4 key assign - T/K ( you can switch Terminal vs. MODBUS)
HMI cmd. -Bumpless
now you can switch terminal/modbus by F4
you have to set pin enable in LINUXCNC to start read-write loop in program.
pin modbus-ok indicates comunication with atv.
then you can read a write other pins.
sorry for my english
Martin
Please Log in to join the conversation.
andypugh wrote:
Swapper wrote: i tried running it and sniffing the serial port and its not putting out any data when i start it.
If you send other data to ttyACM0 do you see serial port activity?
Hi
Yes the "mb2hal" component works and i can read values from the VFD without much issue.
The downside of using mb2hal is that there are none of the logic built in that there is in the altivar comp.
Tried getting it to run by writing the hex values to the registers in the manual, not much success since i'm a blunt tool on hex conversions...
i have noticed that the com is not closed correctly when i close halrun it keeps running and i have to kill the process with kill -9 and then halrun -U
Then i can start halrun again, to me that indicates a problem with the code that its "looping" and does not catch a exit.
fupeama:
i have successfully commissioned and tried the VFD with the same USB > R485 converter from a windows computer with the schneider software and i can run/configure stop and so with that.
The altivar comp is doing all those init things when it starts to communicate with the VFD, its also looks like it sets back some values when exeting.
Please Log in to join the conversation.
Swapper wrote: i have noticed that the com is not closed correctly when i close halrun it keeps running and i have to kill the process with kill -9 and then halrun -U
Then i can start halrun again, to me that indicates a problem with the code that its "looping" and does not catch a exit.
yes this behavior is in case communication is not established.
Now I try make two serial ports connected back to back by socat
socat -d -d PTY: PTY and read ser port in terminal window
sudo cat /dev/pts/3
run atv_vfd comp and I can see comunication from program. (without vfd) only command from atv_vfd.
you can try run atv_vfd with parram -v (verbose) debug information.
I dont remember exactly, but schneider software uses more sofisticated comumication with vfd.
Have you set up vfd for mdb communication?
Martin
Please Log in to join the conversation.
