From: Michał G. <mi...@wp...> - 2009-10-12 10:51:57
|
vh...@li... pisze: > Hello, > I would like to perform some halui commands while the program is running > but I get some errors. > For instance I put a M100 program at the beginning of > my g-code just to make some checks before starting with the production. > Here > there is the code of my M100 program that should home my system. The problem is > that I gat an error: "Can't do that (EMC_AXIS_HOMING) in auto mode with the > interpreter reading." > Just for this reason I used halui.mode.manual and halui. > program.stop but the error is still on. Am I mistaking something? > > Thank you > > Luigi > > > #!/bin/sh > > #homing > halcmd setp halui.mode.manual True > halcmd setp > halui.program.stop True > > halcmd setp halui.joint.0.select True > homed=$(halcmd - > s show pin halui.joint.0.is-homed|cut -c 17) > echo $homed > if [ $homed = "F" ]; > then > halcmd setp halui.joint.selected.home True > fi > > halcmd setp halui.program. > run True > halcmd setp halui.mode.auto True > > exit 0 > > > Hello, You cannot homing machine from command in running program, this is not allowed (and you get error). Instead of putting M100 on begining of your production file you can add pyvcp button that on press will execute your M100 file. Here you have instructions how to do this: http://www.linuxcnc.org/docview/html//hal_pyvcp.html#r1_6_3 http://www.linuxcnc.org/docview/html//gui_halui.html#sub:MDI Andy, setp will work fine for pins and parameters regards, Michael |