Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: tripleblack on June 24, 2009, 09:22:06 AM

Title: turret tool macro
Post by: tripleblack on June 24, 2009, 09:22:06 AM
hi all. i am having difficulty getting a toolchanger macro to work. here is how it has to function.jog the x and z axis to a safe position,activate output19 which switches on an air solenoid, jog a axis to a set position 45,deactivate output 19, activate output 20, deacivate output 20.
here is my macro.

DeActivateSignal(Output20)  " make sure solenoid is realeased.


code"z1x3"                          " jog to safe place for toolchange
While IsMoving ()
Wend
ActivateSignal(Output19)    " turn on solenoid to raise turret
code"g4p1"                        " wait 1 second
code"g0a45"                      " rotate turret
While Ismoving ()
Wend

DeActivateSignal(Output19)   "release solenoid
code"g4p1"

ActivateSignal(Output20)      " turn on solenoid to retract turret

code"g4p1"



 
DeactivateSignal(Output20)    " release solenoid


code"g4p1"                          " wait 1 second

the code skips over the deactivate signal. if i run the outputs individually in mdi, they work . pushing reset deacivates.

the machine is a hardinge chnc3. the turret is driven by stepper motor.





Title: Re: turret tool macro
Post by: zealous on June 25, 2009, 03:37:25 PM
Could you try replacing
Code: [Select]
code "g4p1"   with
Code: [Select]
sleep(1000) and let me know if that fixes it.
Title: Re: turret tool macro
Post by: tripleblack on June 25, 2009, 09:32:02 PM
thanks, i will try it tomorrow.
Title: Re: turret tool macro
Post by: tripleblack on June 29, 2009, 09:07:02 PM
thanks, now it works.
Title: Re: turret tool macro
Post by: zealous on July 01, 2009, 05:19:34 AM
Great to hear