controlling emco tool changer

More
18 Feb 2012 01:21 #17777 by chuck1024
are the big nasty warnings ok?


$ sudo comp --install emco.comp
[sudo] password for chuck:
make -C /usr/src/linux-headers-2.6.24-16-rtai SUBDIRS=`pwd` CC=gcc V=0 -o /Module.symvers modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.24-16-rtai'
CC [M] /tmp/tmpRTfFq7/emco.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: "hal_ready" [/tmp/tmpRTfFq7/emco.ko] undefined!
WARNING: "hal_export_funct" [/tmp/tmpRTfFq7/emco.ko] undefined!
WARNING: "rtapi_snprintf" [/tmp/tmpRTfFq7/emco.ko] undefined!
WARNING: "hal_param_float_newf" [/tmp/tmpRTfFq7/emco.ko] undefined!
WARNING: "hal_pin_s32_newf" [/tmp/tmpRTfFq7/emco.ko] undefined!
WARNING: "hal_pin_bit_newf" [/tmp/tmpRTfFq7/emco.ko] undefined!
WARNING: "hal_malloc" [/tmp/tmpRTfFq7/emco.ko] undefined!
WARNING: "hal_init" [/tmp/tmpRTfFq7/emco.ko] undefined!
WARNING: "hal_exit" [/tmp/tmpRTfFq7/emco.ko] undefined!
CC /tmp/tmpRTfFq7/emco.mod.o
LD [M] /tmp/tmpRTfFq7/emco.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-16-rtai'
cp emco.ko /usr/realtime-2.6.24-16-rtai/modules/emc2/

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

More
18 Feb 2012 01:23 #17778 by BigJohnT
Yep, ignore the warnings but pay attention to the ERRORS.

John

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

More
18 Feb 2012 03:52 #17779 by chuck1024
I'm really in over my head now. I see two "errors" here. One is the error inserting file... This leads me to the question. If you need to rebuild something, do you need to remove the old one before running comp --install?

Seconds error is "invalid usage with args" Do I have something wrong in my preamble of the file?
cs


Print file information:
RUN_IN_PLACE=no
EMC2_DIR=
EMC2_BIN_DIR=/usr/bin
EMC2_TCL_DIR=/usr/share/emc/tcl
EMC2_SCRIPT_DIR=
EMC2_RTLIB_DIR=/usr/realtime-2.6.24-16-rtai/modules/emc2
EMC2_CONFIG_DIR=
EMC2_LANG_DIR=/usr/share/emc/tcl/msgs
INIVAR=inivar
HALCMD=halcmd
EMC2_EMCSH=/usr/bin/wish8.4
EMC2 - 2.4.6
Machine configuration directory is '/home/chuck/emc2/configs/emco_changer'
Machine configuration file is 'emco_changer.ini'
INIFILE=/home/chuck/emc2/configs/emco_changer/emco_changer.ini
PARAMETER_FILE=emc.var
EMCMOT=motmod
EMCIO=io
TASK=milltask
HALUI=
DISPLAY=axis
NML_FILE=
Starting EMC2...
Starting EMC2 server program: emcsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Realtime system did not load
Shutting down and cleaning up EMC2...
Killing task emcsvr, PID=16587
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments
Cleanup done

Debug file information:
insmod: error inserting '/usr/realtime-2.6.24-16-rtai/modules/rtai_hal.ko': -1 File exists
16587
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components
/usr/bin/emc_module_helper: Invalid usage with args: remove emcochanger

Usage: /usr/bin/emc_module_helper insert /path/to/module.ext [param1=value1 ...]

where module is one of:
rtai_math
rtai_sem
rtai_shm
rtai_fifos
rtai_up
rtai_lxrt
rtai_hal
rtai_sched
rtai_smi
rtai
rt_mem_mgr
adeos
rtl_time
rtl_sched
rtl_posixio
rtl_fifo
rtl
mbuff

the path starts with one of:
/lib/modules
/usr/realtime

and the extension is one of:
.ko

or the module is in the directory /usr/realtime-2.6.24-16-rtai/modules/emc2

OR

/usr/bin/emc_module_helper remove module

where module is one of the modules listed above.

<commandline>:0: exit value: 1
<commandline>:0: rmmod failed, returned -1
<commandline>:0: unloadrt failed
ERROR: Module hal_lib is in use by emco
ERROR: Module rtapi is in use by emco,hal_lib
ERROR: Module rtai_math does not exist in /proc/modules
ERROR: Module rtai_sem is in use by rtapi
ERROR: Module rtai_fifos is in use by rtapi
ERROR: Module rtai_sched is in use by rtapi,rtai_sem,rtai_fifos
ERROR: Module rtai_hal is in use by rtapi,rtai_sem,rtai_fifos,rtai_sched

Kernel message information:
[22407.799426] I-pipe: Domain RTAI registered.
[22407.799449] RTAI[hal]: <3.6.1> mounted over IPIPE-NOTHREADS 2.0-04.
[22407.799453] RTAI[hal]: compiled with gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3).
[22407.799460] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[22407.799464] PIPELINE layers:
[22407.799468] f8a91000 9ac15d93 RTAI 200
[22407.799471] c0383180 0 Linux 100
[22407.822770] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[22407.823673] RTAI[sched]: loaded (IMMEDIATE, UP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
[22407.823681] RTAI[sched]: hard timer type/freq = 8254-PIT/1193180(Hz); default timing: periodic; linear timed lists.
[22407.823688] RTAI[sched]: Linux timer freq = 250 (Hz), CPU freq = 1503450000 hz.
[22407.823692] RTAI[sched]: timer setup = 2010 ns, resched latency = 2689 ns.
[22407.931760] RTAI[math]: loaded.
[22408.248538] config string '0x378 out '
[22411.135075] RTAI[math]: unloaded.

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

More
18 Feb 2012 10:49 #17787 by ArcEye
Hi

do you need to remove the old one before running comp --install?

It should just overwrite the previous module.

insmod: error inserting '/usr/realtime-2.6.24-16-rtai/modules/rtai_hal.ko': -1 File exists

This error seems to come up when part of the rtai system has not quit cleanly from a previous session or has otherwise become unavailable.

The generic advice is to close everything down and reboot.

wiki.linuxcnc.org/cgi-bin/wiki.pl?TroubleShooting does give this alternative, bit I haven't tried it personally

A script is provided with emc2 to load and unload all the realtime modules, and is much quicker for troubleshooting than starting and stopping all of emc2. To use it, type:

/etc/init.d/realtime

Seconds error is "invalid usage with args"

I think this is output not normally seen, it is to do with the attempt to close emc cleanly and rmmod failing to remove modules.

ERROR: Module hal_lib is in use by emco

This at least shows that your module loaded but rtai appears screwed up

Reboot is my suggestion

regards

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

More
18 Feb 2012 10:56 #17788 by ArcEye
BigJohnT wrote:

The program comp is installed with emc2-dev. You can just add that to the synaptic package manager or iirc from a terminal say
sudo apt-get build-dep emc2
The other stuff you can find it in the synaptic package manager and remove it there.
Crap, the documents say nothing about where comp is...

Would be a good idea to update the docs John.

Because I had already built a new LinuxCNC version from sources before I started mucking around with comp, I had no idea why some people could not find comp, or that emc2-dev existed.
Can't recall it being mentioned anywhere, it is certainly not in the linuxcnc.org/docs/html/hal_comp.html, because I just scanned it.

cheers

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

More
18 Feb 2012 12:35 #17791 by BigJohnT
I found a note here but have not confirmed yet if both need installing or not.

wiki.linuxcnc.org/cgi-bin/wiki.pl?HowToWriteNewHalComponent

Note: In order to compile comp modules you must install the packages emc2-dev and build-essential.


John

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

More
18 Feb 2012 14:50 - 18 Feb 2012 14:51 #17797 by ArcEye

have not confirmed yet if both need installing or not.


Given that it has dependencies for g++ and libc6-dev and even bash, I would have thought so.

build-essential is an unusual package, I have never looked into it before. It does not seem to contain anything itself but has dependencies which ensure all the other packages to compile and build debs etc are installed.

regards
Last edit: 18 Feb 2012 14:51 by ArcEye.

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

More
19 Feb 2012 05:45 #17815 by chuck1024
Thanks for all the help!!!!
After cleaning up a bunch of stuff and making some code changes, I managed to make the emoc tool turret work.
The orac tool changer was a reasonable model containing elements and concepts that I could use but the end
results don't look much alike.

I have a lot of cleanup work to do. Should I post the completed stuff here when it is done?
It would consist of a custom hal file and the toolchanger.comp file.

I need to install a second parallel port so I have enough input pins for the spindle encoder and the toolchanger.

chuck

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

More
19 Feb 2012 08:28 #17818 by cmorley
Yes please share your work.
post it here;
wiki.linuxcnc.org/cgi-bin/wiki.pl?ContributedComponents

Then reference it here.
If you want to do a big writeup then make a wiki entry too.

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

More
20 Feb 2012 04:12 #17851 by chuck1024
I added a PCI multi I/O parallel card. NetMos Single port.

I added the 0xac00 to the loadrt line and I added three lines of "addf" for parallel port 1.

The integration manual does not show the "out" port of the loadrt and it does not mention anythng about reset base thread.

loadrt hal_parport cfg="0x378 0xac00 out " # out not in manual. ????

addf parport.0.read base-thread
addf parport.1.read base-thread

addf parport.0.write base-thread
addf parport.1.write base-thread
addf parport.0.reset base-thread
addf parport.1.reset base-thread #Not in manual. Should it be here????????

Now about half the time, I get "RTAPI: ERROR: unexpected real time delay on task 1" when I start emc
the second parallel port seems to be working. Am I doing something wrong?

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

Time to create page: 0.098 seconds
Powered by Kunena Forum