Hello Guest it is September 24, 2020, 11:04:05 AM

Author Topic: Rotate A Axis via Macro Code  (Read 1641 times)

0 Members and 1 Guest are viewing this topic.

Rotate A Axis via Macro Code
« 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
Re: Rotate A Axis via Macro Code
« Reply #1 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.
Regards,
Ray L.
Re: Rotate A Axis via Macro Code
« Reply #2 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.
Re: Rotate A Axis via Macro Code
« Reply #3 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.
Regards,
Ray L.