1691
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Dim CurrentFeed As Double
Dim CurrentAbsInc, CurrentGmode As Boolean
Sub Main()
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
code "G90"
code "F100"
ReturnG90G91State 'subroutine'
End Sub
Sub ReturnG90G91State()
If CurrentAbsInc = True Then 'if G91 was in effect before then return to it
Code "G90"
Else
Code "G91"
End If
If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
Code "G0"
Else
Code "G1"
End If
Code "F" &CurrentFeed 'restore starting feed rate
End Sub