501
General Mach Discussion / Re: code for a repeat single axis driller
« on: January 09, 2016, 11:47:13 AM »
This would be an example of a macro(m100) that could drive your function.
' M100 Driller macro
Lcnt = 0 ' Set Loop Counter to Zero
ActivateSignal(Output10) ' Create a Momentary signal of 1 sec to start driller function
Sleep(1000)
DeactivateSignal(Output10)
While Not Isactive(Input10) OR Lcnt <10000 ' Wait for the Driller to signal DONE or time out
IF Lcnt > 10000 then ' IF timeout occurs then cancel Program
Message" Driller did not respond"
DoButton(3)
End
End if
Lcnt = (Lcnt +1) 'Increase count by 1 each loop
Wend
While Ismoving()
Wend
End
' M100 Driller macro
Lcnt = 0 ' Set Loop Counter to Zero
ActivateSignal(Output10) ' Create a Momentary signal of 1 sec to start driller function
Sleep(1000)
DeactivateSignal(Output10)
While Not Isactive(Input10) OR Lcnt <10000 ' Wait for the Driller to signal DONE or time out
IF Lcnt > 10000 then ' IF timeout occurs then cancel Program
Message" Driller did not respond"
DoButton(3)
End
End if
Lcnt = (Lcnt +1) 'Increase count by 1 each loop
Wend
While Ismoving()
Wend
End