1271
General Mach Discussion / Re: How to make the machine not operate unless it is homed first...
« on: April 16, 2007, 09:35:58 PM »
This will do it... You just need to change the UserLED to some other LED...
Sub Main()'//this must be at the start of the function
If (GetUserLED (1100)= true)Then'//something to show that you don't need to run the Macro
Exit Sub'//Get OUT and don't run the code!
End If
If GetLed (808)=1 Then 'Std Y axis home LED
DoOEMButton (250) 'Stop Jog X
DoOEMButton (251) 'Stop Jog Y
DoOEMButton (252) 'Stop Jog Z
DoOEMButton (253) 'Stop Jog A
DoOEMButton (254) 'Stop Jog B
CODE "(HOME MACHINE BEFORE USE)"
Else
DoOEMButton (290) 'Allow Jog X
DoOEMButton (291) 'Allow Jog Y
DoOEMButton (292) 'Allow Jog Z
DoOEMButton (293) 'Allow Jog A
DoOEMButton (294) 'Allow Jog B
CODE "(Ready to go)"
End If
End Sub'//This is the End of the SubMain function
Main'//Put this at the end of the code file
Sub Main()'//this must be at the start of the function
If (GetUserLED (1100)= true)Then'//something to show that you don't need to run the Macro
Exit Sub'//Get OUT and don't run the code!
End If
If GetLed (808)=1 Then 'Std Y axis home LED
DoOEMButton (250) 'Stop Jog X
DoOEMButton (251) 'Stop Jog Y
DoOEMButton (252) 'Stop Jog Z
DoOEMButton (253) 'Stop Jog A
DoOEMButton (254) 'Stop Jog B
CODE "(HOME MACHINE BEFORE USE)"
Else
DoOEMButton (290) 'Allow Jog X
DoOEMButton (291) 'Allow Jog Y
DoOEMButton (292) 'Allow Jog Z
DoOEMButton (293) 'Allow Jog A
DoOEMButton (294) 'Allow Jog B
CODE "(Ready to go)"
End If
End Sub'//This is the End of the SubMain function
Main'//Put this at the end of the code file