Hello Guest it is April 20, 2024, 07:38:32 AM

Author Topic: lathe turret macro  (Read 1836 times)

0 Members and 1 Guest are viewing this topic.

Offline fast89

*
  •  154 154
    • View Profile
lathe turret macro
« 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

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: lathe turret macro
« Reply #1 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

Offline fast89

*
  •  154 154
    • View Profile
Re: lathe turret macro
« Reply #2 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.