1
CS-Lab / Problems wit G31/M31 and subs
« on: May 14, 2018, 09:50:42 AM »
I have Mach3 v3.043.062 wit CSMIO-S and for the moment I am using the standard 1024.set.
After srtuggling with G31/M31 on some offset-macros I ended up with the following problem:
At the very end of the script I want to restore the changed parameters to their Original state (quite Obvious I think). But I cannot get this elementary and certainly most simple thing to work!
All documentation I find on DRO, LED and BUTTONs says the same: OEMLED(48) is true when G90 is active. And yet this does not work??
I don't know if it is my own fault, but I believe teh available "official" documentation on writing scripts is not at all clear. IS there more/better on the net?
Is there anywhere a COMPLETE detailed list of DRO, LED and BUTTONS? One that goes beyond OEM(1000)?
After srtuggling with G31/M31 on some offset-macros I ended up with the following problem:
At the very end of the script I want to restore the changed parameters to their Original state (quite Obvious I think). But I cannot get this elementary and certainly most simple thing to work!
All documentation I find on DRO, LED and BUTTONs says the same: OEMLED(48) is true when G90 is active. And yet this does not work??
Code: [Select]
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"
End If
If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
Code "G0"
End If
Code "F" &CurrentFeed 'restore starting feed rate
End Sub
I don't know if it is my own fault, but I believe teh available "official" documentation on writing scripts is not at all clear. IS there more/better on the net?
Is there anywhere a COMPLETE detailed list of DRO, LED and BUTTONS? One that goes beyond OEM(1000)?