Hi all

I have a Denford Easiturn 3 which I have retrofitted with a CS Labs CSIMO-IPS controller running Mach3 from a fan less PC using Windows 7 embedded, which normally runs rather nicely, albeit the tool table is driving me nuts. Anyway, I have managed to get hold of an fit one of the original Denford 8 Station auto tool changers, which I am operating using the following Macro that was develop by Corey Renner. If I go to the Midi line and type in T0202 M56 or M56 T0202 then it selects tool 2 and runs the macro to then call up tool 2 on the changer. When I was originally testing the changer I wrote a short G-code program along the lines of M56 T0101, G04 P5000, M56 T0202, G04 P5000 etc, and it ran just fine. However, now when I try to call the code up within a program it stubbornly refuses to run the macro and yet the macro still runs fine if either T0202 M56 or M56 T0202 are entered in the midi line. Anyone got any idea as to what the problem is, as I suspect its something stupidly simple such as a setting somewhere in the General Config tab, but I can not fathom what. For information the action on tool change is set to auto tool changer within the General Config window. Thanks Andrew

'Denford Turret Macro, Corey Renner v4
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(700) 'delay in ms to over-run selected tool position
SelectedTool = NewTool


Call StopTool


sleep(2000) '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 ("Toolchange has FAILED!!! Try adjusting the over-run delay")
code "M00"
End If


SetCurrentTool(NewTool )


'//// Subroutines ////


Sub StartTool
ActivateSignal(Output3)
End Sub


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


Sub Stoptool
DeActivateSignal(Output3)
End Sub

Similar Threads: