Mach Discussion > Mach Screens

Opening g-code

(1/3) > >>

Seba:
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

Graham Waterworth:
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)

Seba:
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.

Seba:
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

ZASto:

--- Quote from: Graham Waterworth on September 20, 2019, 08:22:55 PM ---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



--- End quote ---

Wel, Graham
The incrementing of the #1200 works, incrementing is not shown in DRO


Navigation

[0] Message Index

[#] Next page

Go to full version