Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: Hellfire on December 09, 2016, 06:32:12 AM

Title: help with atc macro
Post by: Hellfire on December 09, 2016, 06:32:12 AM
hi
could someone help me with this macro, i want to put some sort of safety features in it. e.g. check correct tool has been selected before continuing
If GetSelectedTool()=GetCurrentTool() Then
End If


If GetSelectedTool =1 Then
ActivateSignal(Output5)
While Not IsActive(oemtrig1)
Wend
DeactivateSignal(Output5)
ActivateSignal(Output6)
While Not IsActive(oemtrig11)
Wend
Sleep 1000
DeactivateSignal(Output6)
End If







If GetSelectedTool =2 Then
ActivateSignal(Output5)
While Not IsActive(oemtrig2)
Wend
DeactivateSignal(Output5)
ActivateSignal(Output6)
While Not IsActive(oemtrig11)
Wend
Sleep 1000
DeactivateSignal(Output6)
End If






If GetSelectedTool =3 Then
ActivateSignal(Output5)
While Not IsActive(oemtrig3)
Wend
DeactivateSignal(Output5)
ActivateSignal(Output6)
While Not IsActive(oemtrig11)
Wend
Sleep 1000
DeactivateSignal(Output6)
End If




If GetSelectedTool =4 Then
ActivateSignal(Output5)
While Not IsActive(oemtrig4)
Wend
DeactivateSignal(Output5)
ActivateSignal(Output6)
While Not IsActive(oemtrig11)
Wend
Sleep 1000
DeactivateSignal(Output6)
End If




If GetSelectedTool =5 Then
ActivateSignal(Output5)
While Not IsActive(oemtrig5)
Wend
DeactivateSignal(Output5)
ActivateSignal(Output6)
While Not IsActive(oemtrig11)
Wend
Sleep 1000
DeactivateSignal(Output6)
End If




If GetSelectedTool =6 Then
ActivateSignal(Output5)
While Not IsActive(oemtrig6)
Wend
DeactivateSignal(Output5)
ActivateSignal(Output6)
While Not IsActive(oemtrig11)
Wend
Sleep 1000
DeactivateSignal(Output6)
End If




If GetSelectedTool =7 Then
ActivateSignal(Output5)
While Not IsActive(oemtrig7)
Wend
DeactivateSignal(Output5)
ActivateSignal(Output6)
While Not IsActive(oemtrig11)
Wend
Sleep 1000
DeactivateSignal(Output6)
End If




If GetSelectedTool =8 Then
ActivateSignal(Output5)
While Not IsActive(oemtrig8)
Wend
DeactivateSignal(Output5)
ActivateSignal(Output6)
While Not IsActive(oemtrig11)
Wend
Sleep 1000
DeactivateSignal(Output6)
End If
End
Title: Re: help with atc macro
Post by: Hellfire on December 15, 2016, 05:59:36 PM
I am assuming there is nothing I can do to add safety protocols into it ?