Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: MRM RCModels on March 03, 2013, 07:14:17 PM

Title: Rotate A Axis via Macro Code
Post by: MRM RCModels on March 03, 2013, 07:14:17 PM
All,

I'm writing a lathe turret tool change macro and am having a hell of a time finding a way to rotate the A Axis via a macro function. The A Axis Stepper is controlled by a G540. I would like the stepper to rotate freely if possible (like it was jogging).

Thanks
Title: Re: Rotate A Axis via Macro Code
Post by: HimyKabibble on March 03, 2013, 07:27:52 PM
Assuming A is defined as a rotary axis:

Code "G0 An.nnn"
while IsMoving()
    Sleep(10)

Where n.nnn is the angle to go to should do it.

Regards,
Ray L.
Title: Re: Rotate A Axis via Macro Code
Post by: MRM RCModels on March 03, 2013, 07:34:56 PM
Thanks Ray. How do you stop the rotation? I need the axis to rotate while searching for the next tool change then stop.
Title: Re: Rotate A Axis via Macro Code
Post by: HimyKabibble on March 03, 2013, 07:48:42 PM
If you want it to just continue rotating until you stop it, use JogOn() and JogOff().  Download this:

http://www.machsupport.com/docs/Mach3_V3.x_Macro_Prog_Ref.pdf

and it should answer all your questions (I wrote this about 4 years ago...).

Regards,
Ray L.