I want to return some learning back to this thread and thank the contributors.
Below is a test of a loop counter for a subroutine. I used the Tool DRO to display
the counts because I do not use this feature at all. Some day I may alter the
Mach screen to display a loop counter DRO.
I use Mach3 to run a Shark router for making violin parts. It takes the grunt work away,
namely gouging wood. Of course, there is a LOT of finishing work needed
afterwards.
Again, thanks to all.
Mike
-------------
G90 G21 G58 G40 G50
(a)
M98 P1000 L10
M201 (Clear the Tool Counter)
M30 (END)
O1000
M200 (Increment to Loop Counter)
G04 P1000 (Min. is 100 ms)
M99
--------------
M200
If IsLoading() Then
'Do Nothing, program loading
Else
Dim Lcount As Integer
Lcount = GetOEMDRO(222) 'Loop counter
SetOEMDRO(824,Lcount) 'Tool # DRO
End If
--------------
M201
' clear the Tool DRO
If IsLoading() Then
'Do Nothing, program loading
Else
Dim Lcount As Integer
Lcount = 0
SetOEMDRO(824,Lcount) 'Tool # DRO
End If
-------------