Denford Orac Turret working on Mach 3 macro

All info relating to the Denford ORAC CNC lathes

Moderators: Martin, Steve, Mr Magoo

andyh
Posts: 5
Joined: Wed 04 Oct , 2017 15:09 pm

Re: Denford Orac Turret working on Mach 3 macro

Post by andyh » Mon 09 Oct , 2017 21:02 pm

I am not sure why it wouldn't work in the end. I got my head around the script and changed it. Decided to do it slightly different, i have it working now. I will post mine up as it may help someone in the future who is searching. Something i have noticed is that the macro does not have anything relating to positions in it. Will mach3 sort out its self out moving in and out of the last position to perform a tool change? Or does this all depend on what you are using to produce gcode?

Keith Phillips
Posts: 1
Joined: Sat 16 Jan , 2021 11:51 am
Hardware/Software: Orac Triac vmc Mach software

Re: Denford Orac Turret working on Mach 3 macro

Post by Keith Phillips » Sat 16 Jan , 2021 12:03 pm

Hello I rejoined to share the macro from 2014 for the auto toolchanger in mach3......I thought I had put it here....maybe it was the mach support site.

anyhoo, I have the lathe back for an upgrade to smoothstepper and more IO and thought I'd put it here as well.

IO will need changing to the ones you are using.

Code: Select all

Tool = GetSelectedTool()
OldTool = GetCurrentTool()
NewTool = Tool
MaxToolNum = 8 'Max number of tools for the changer

While NewTool > MaxToolNum
NewTool = Question ("Enter New Tool Number Up To " & MaxToolNum)
Wend

Call StartTool

While SelectedTool <> NewTool
Call CheckPins
sleep(20)
Wend

sleep(400) 'delay in ms to over-run selected tool position
SelectedTool = NewTool

Call StopTool

sleep(400) 'delay to allow turret to lock into position
Call CheckPins
If SelectedTool <> NewTool Then 'verify that correct tool has locked in-place. Beep, announce and stop program if not
Beep
MsgBox ("Did You Select An Existing Tool?")
code "M00"
End If

SetCurrentTool(NewTool )

'//// Subroutines ////

Sub StartTool
 ActivateSignal(Output3) 
End Sub

Sub CheckPins 
 If Not IsActive(Input1) And Not IsActive(Input2) And Not IsActive(Input3) Then
 SelectedTool = 1
 End If 
 If IsActive(Input1) And Not IsActive(Input2) And Not IsActive(Input3) Then
 SelectedTool = 2
 End If
 If IsActive(Input1) And Not IsActive(Input2) And IsActive(Input3) Then
 SelectedTool = 3
 End If
 If IsActive(Input1) And IsActive(Input2) And IsActive(Input3) Then
 SelectedTool = 4
 End If
 If IsActive(Input1) And IsActive(Input2) And Not IsActive(Input3) Then
 SelectedTool = 5
 End If
 If Not IsActive(Input1) And IsActive(Input2) And Not IsActive(Input3) Then
 SelectedTool = 6
 End If
 If Not IsActive(Input1) And IsActive(Input2) And IsActive(Input3) Then
 SelectedTool = 7
 End If
 If Not IsActive(Input1) And Not IsActive(Input2) And IsActive(Input3) Then
 SelectedTool = 8
 End If 
End Sub

Sub Stoptool
 DeActivateSignal(Output3) 
End Sub               
Also Angel Tech.....I have a stepper motor here that I sold you a long time ago.....finally removed it......not got any of the original details and can't access the original details.

Post Reply