Hello Guest it is April 25, 2024, 02:52:31 AM

Show Posts

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.


Topics - RikV

Pages: 1
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??

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)?

Pages: 1