Mach Discussion > Mach Screens
LIcznik
ZASto:
T1M6
G17
G0X09.048Y08.090Z0
G0X0.000Z0.000
#1200=#1200+1
M30
Do you see where you made a mistake?
In the other topic of yours Graham wrote:
--- Quote ---Then on the end of every g-code file just before the M30 enter
#1200 = #1200 +1
--- End quote ---
Seba:
But a g-code error pops up
ZASto:
--- Quote from: Seba on September 28, 2019, 05:08:38 PM ---But a g-code error pops up
--- End quote ---
--- Code: ---T1M6
G17
G0X09.048Y08.090Z0
G0X0.000Z0.000
#1200=[#1200+1]
M30
%
--- End code ---
This one does not throw error :)
When you have math operations, they have to be enclosed in square brackets. Notice the percent (%) sign at the end of the program. If your program does not have CRLF after M30, this is the way to be on the safe side, % is anyway ignored.
HTH
Seba:
Thank you very much but I still don't count the number of completed items
ZASto:
--- Quote from: Seba on September 29, 2019, 05:00:50 AM ---Thank you very much but I still don't count the number of completed items
--- End quote ---
Not incrementing DRO, user variable incrementing.
But, you can write a macro and add it to your macro folder and it works perfectly:
--- Code: ---count = getuserdro(1200)
count = count + 1
detuserdro(1200, count)
--- End code ---
Save it as M900.m1s
then add it to your GCode program:
--- Code: ---T1M6
G17
G0X09.048Y08.090Z0
G0X0.000Z0.000
M900
M30
%
--- End code ---
It increments DRO 1200 every time before rewinding program.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version