Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: fast89 on August 19, 2015, 01:42:03 PM

Title: lathe turret macro
Post by: fast89 on August 19, 2015, 01:42:03 PM
Trying to automate a hardinge octagon turret. I have a rotary air actuator connected to it with a solenoid to rotate and re-lock the turret. The problem i have is getting the macro to reset to tool#1 after tool#8. I'm not calling a tool number at this point, i just want it to index one position and change the number accordingly. How do i make it reset to 1 after 8? I've attached the macro

Title: Re: lathe turret macro
Post by: Hood on August 19, 2015, 02:19:38 PM
Try this in place of the code you have if you are just using the macro for testing purposes.

For the real macro you will have to add a few more lines as you will be removing the tool + 1 part I would imagine.


 ActivateSignal(OutPut20)
 Sleep 1200
 DeActivateSignal(OutPut20)
   Tool = GetSelectedTool() Mod 8
      SetCurrentTool( tool + 1)


Hood
Title: Re: lathe turret macro
Post by: fast89 on August 19, 2015, 03:38:49 PM
hood, that was perfect. and yeah i have alot more to do. i'm sure it will be making parts before i ever finish it. Thats usually the way it goes.