Machsupport Forum
Mach Discussion => Mach Screens => Topic started by: Seba on September 20, 2019, 04:04:32 PM
-
Hello. Please help, how do I set up Mach Counter in Mach Screens?
My second request was wanted on the desktop waving to insert keys with g-cods because I still mill 5 same items.
Thank you
-
Create a button a Label and a DRO on the screen of your choice.
Set the DRO to a user variable e.g. 1200
Set label to "Part Counter" and position close to DRO
Label the button "Reset Counter" and set it to run vb script
Enter VB code :-
SetUserDRO(1200,0)
Save screen.
Then on the end of every g-code file just before the M30 enter
#1200 = [#1200 + 1]
Or you can set up a Macro to do it
M1025.m1s
count = GetUserDRO(1200)
count = count + 1
SetUserDRO(1200, count)
-
Hello.
thank you very much for your help, I can ask for a more detailed explanation because I know neither programming nor too much on Mach 3, so I would be very grateful for some file or video tutorial.
-
hello how to add an extra button in
Mach Screens which will open g-cod from file C:\Users\Sebastian\Desktop\PRACA\CNC\ciastk.tap
-
Create a button a Label and a DRO on the screen of your choice.
Set the DRO to a user variable e.g. 1200
Set label to "Part Counter" and position close to DRO
Label the button "Reset Counter" and set it to run vb script
Enter VB code :-
setuserdro(1200,0)
Save screen.
Then on the end of every g-code file just before the M30 enter
#1200 = #1200 +1
Wel, Graham
The incrementing of the #1200 works, incrementing is not shown in DRO
-
What is wrong?
-
Not incrementing DRO, user variable incrementing.
-
Try a different DRO, #1200 may be in use by another macro
-
You were right, I use 1200 for some other things, but...
even if I change the variable to, eg. 999 or 1000 (with corresponding changes in screenset), still no update of DRO.
It only works if I call a macro.
M1100.m1s:
counter = getuserdro(1100)
counter = counter + 1
setuserdro(1100, counter)
Anyway, I tried to help Sebastian since I do need counters :)
-
That should not be a problem, just add the M1100 to the end of your program and it will work.
How did you want it to work?
-
Graham, it works through macro, that was the point of my writing.
It does not display of variable in DRO.
Anyway, Sebastians problem is solved with macro.