开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

parts counter


 

I looked in the forums and did find "answers" to? this but nothing that did not seem like a lot of work and beyond my current understanding of how mach 3 works and how to hack it. So, the question is, is it possible to add a parts counter that keeps track of how many times a gcode is run? I can probably edit my screen as I have done it in the past and can probably re-figure out how the editor works.

I would like to have an on screen counter either in the main program space or elsewhere and ideally would like to be able to decrement the counter in case a part was rejected. I am making a lot of little wooden parts and even if the job runs properly some parts are not good enough to keep because of things like out of square stock that was not noticed or excessive damage caused by crazy grain.?

I have various electrical counters that i can use as a switch so if this will be a big project the simple electrical switch would be easier. I am currently using a counter app on my phone but the environment is too messy for the phone and I am not good at remembering to increment manually.?

I just thought of something that might work but it will not allow for decrementing. I could keep all the bad parts until I finish the job and then count them separately. I have a foot switch that starts the program. I think it might have two internal switches so one could operate the counter.

I also like programming Arduinos and might have something thrown together that I can convert to some sort of smart counter but I am running out of time for projects. Need to just get some work done and spend less time with distractions.

Still a hopefully simple computer bed solution would be best.

?
?
Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...
http://www.spencerserolls.com
http://www.poodlex.com
(425) 791-0309
(707) 223-8212


 

开云体育

G-Code has a range of variables (#500-#1000 IIRC) where you can store stuff like that.

?

Tony

?

From: [email protected] [mailto:[email protected]] On Behalf Of spencer@...
Sent: Saturday, 15 February 2020 3:18 AM
To: [email protected]
Subject: [MachCNC] parts counter

?

I looked in the forums and did find "answers" to? this but nothing that did not seem like a lot of work and beyond my current understanding of how mach 3 works and how to hack it. So, the question is, is it possible to add a parts counter that keeps track of how many times a gcode is run? I can probably edit my screen as I have done it in the past and can probably re-figure out how the editor works.

?

I would like to have an on screen counter either in the main program space or elsewhere and ideally would like to be able to decrement the counter in case a part was rejected. I am making a lot of little wooden parts and even if the job runs properly some parts are not good enough to keep because of things like out of square stock that was not noticed or excessive damage caused by crazy grain.?

?

I have various electrical counters that i can use as a switch so if this will be a big project the simple electrical switch would be easier. I am currently using a counter app on my phone but the environment is too messy for the phone and I am not good at remembering to increment manually.?

?

I just thought of something that might work but it will not allow for decrementing. I could keep all the bad parts until I finish the job and then count them separately. I have a foot switch that starts the program. I think it might have two internal switches so one could operate the counter.

?

I also like programming Arduinos and might have something thrown together that I can convert to some sort of smart counter but I am running out of time for projects. Need to just get some work done and spend less time with distractions.

?

Still a hopefully simple computer bed solution would be best.

?

?

?

Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...
http://www.spencerserolls.com
http://www.poodlex.com
(425) 791-0309
(707) 223-8212

?


Stephen Gould
 

开云体育

Spencer,
Interesting project, would you need to have a counter for each part type you made, or just the one currently on the cancel? The latter is easier, but you would still need to remember to reset if you changed the part.
Regards
Steve Gould
Hampshire
Uk

Get


From: [email protected] <[email protected]> on behalf of Tony Smith <ajsmith1968@...>
Sent: Saturday, February 15, 2020 4:08:54 AM
To: [email protected] <[email protected]>
Subject: Re: [MachCNC] parts counter
?

G-Code has a range of variables (#500-#1000 IIRC) where you can store stuff like that.

?

Tony

?

From: [email protected] [mailto:[email protected]] On Behalf Of spencer@...
Sent: Saturday, 15 February 2020 3:18 AM
To: [email protected]
Subject: [MachCNC] parts counter

?

I looked in the forums and did find "answers" to? this but nothing that did not seem like a lot of work and beyond my current understanding of how mach 3 works and how to hack it. So, the question is, is it possible to add a parts counter that keeps track of how many times a gcode is run? I can probably edit my screen as I have done it in the past and can probably re-figure out how the editor works.

?

I would like to have an on screen counter either in the main program space or elsewhere and ideally would like to be able to decrement the counter in case a part was rejected. I am making a lot of little wooden parts and even if the job runs properly some parts are not good enough to keep because of things like out of square stock that was not noticed or excessive damage caused by crazy grain.?

?

I have various electrical counters that i can use as a switch so if this will be a big project the simple electrical switch would be easier. I am currently using a counter app on my phone but the environment is too messy for the phone and I am not good at remembering to increment manually.?

?

I just thought of something that might work but it will not allow for decrementing. I could keep all the bad parts until I finish the job and then count them separately. I have a foot switch that starts the program. I think it might have two internal switches so one could operate the counter.

?

I also like programming Arduinos and might have something thrown together that I can convert to some sort of smart counter but I am running out of time for projects. Need to just get some work done and spend less time with distractions.

?

Still a hopefully simple computer bed solution would be best.

?

?

?

Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...
http://www.spencerserolls.com
http://www.poodlex.com
(425) 791-0309
(707) 223-8212

?


 
Edited

It sounds like the parts you are talking about are not using the 4th axis A. If you set A to zero at the start of your loop you can have a counter that increases by 1 at the end of the loop and moves A to that value. The A axis DRO will then act as a visible loop count.

Here is what I expect it to have added to the code:-

#111=[0] ; pick a suitable number for the subroutine counter
G0 A 0 ; set A to zero, if necessary you can put an M1 pause here to remind you if A has a large value to set zero and restart.

; call the subroutine

; end program

;? subroutine

#111=[#111 + 1]
G0 A [#111]

; return from subroutine

If you have not got the A axis set up then it should not be hard to set it up with a high speed to simulate it as required for this process.? If you are using A and are willing to modify the screen then use axis B and add the B axis DRO somewhere.

Martin


 

开云体育

I just thought of something that might work but it will not allow for decrementing. I could keep all the bad parts until I finish the job and then count them separately.”

?

What about two bins one bin for good parts, one bin for bad parts and a set of weighing scales.


 

i was going to add an electrical counter but that would of course take time to get right and not just destroy switchs. could use a hall effect switch. i had a nice little counter on my punch press that worked that way but i can't find it.

your suggestion has merit. i just happen to have a large digital platform scale that is not being used. it might even have parts counting as a feature. if not, all i need to do is to calculate the weight of the target number. the only reason i want to count parts is because it is horribly boring to make them and some times i can't wait until i have enough to ship.?

this is a solution i can put into effect within minutes and allows me to use my few remaining brain cells for something more important.
thanks for thinking outside the box.

?
?
Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...


(425) 791-0309
(707) 223-8212

------ Original Message ------
From: "phill005" <phill05@...>
Sent: 2/15/2020 1:50:48 AM
Subject: Re: [MachCNC] parts counter

I just thought of something that might work but it will not allow for decrementing. I could keep all the bad parts until I finish the job and then count them separately.”

?

What about two bins one bin for good parts, one bin for bad parts and a set of weighing scales.


 

that looks like an easy solution. i am using the A axis. i should post a video some day. the machine is pretty neat but still full of bugs after just 7 years working on it.?

i would like to add a B axis dro to the screen but might need to do some searching to find a computer that will run the screen editor. most of my computers are running win 10 now and i am almost certain that the screen editor does not work anymore. i looked at it briefly and could not get anything to work.

i do have an xp machine running the router so i can probably do it there.

any suggestions on the best way (which program etc) to edit a screen, possibly on a win 10 computer?

?
?
Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...


(425) 791-0309
(707) 223-8212

------ Original Message ------
From: "Martin Connelly" <martin.at.leasingham@...>
Sent: 2/15/2020 1:23:12 AM
Subject: Re: [MachCNC] parts counter

[Edited Message Follows]

It sounds like the parts you are talking about are not using the 4th axis A. If you set A to zero at the start of your loop you can have a counter that increases by 1 at the end of the loop and moves A to that value. The A axis DRO will then act as a visible loop count.

Here is what I expect it to have added to the code:-

#111=[0] ; pick a suitable number for the subroutine counter
G0 A 0 ; set A to zero, if necessary you can put an M1 pause here to remind you if A has a large value to set zero and restart.

; call the subroutine

; end program

;? subroutine

#111=[#111 + 1]
G0 A [#111]

; return from subroutine

If you have not got the A axis set up then it should not be hard to set it up with a high speed to simulate it as required for this process.? If you are using A and are willing to modify the screen then use axis B and add the B axis DRO somewhere.

Martin


 

i think i just confirmed that none of the screen editors work on win 10 64 bit. so if i want to edit a screen, should i just try doing it with an xp computer? or maybe try it in virtual xp?? my only really nice computer with a good keyboard mouse and nice display is my win 10 computer.

?
?
Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...


(425) 791-0309
(707) 223-8212

------ Original Message ------
From: "Spencer Chase" <spencer@...>
Sent: 2/15/2020 11:04:22 AM
Subject: Re[2]: [MachCNC] parts counter

that looks like an easy solution. i am using the A axis. i should post a video some day. the machine is pretty neat but still full of bugs after just 7 years working on it.?

i would like to add a B axis dro to the screen but might need to do some searching to find a computer that will run the screen editor. most of my computers are running win 10 now and i am almost certain that the screen editor does not work anymore. i looked at it briefly and could not get anything to work.

i do have an xp machine running the router so i can probably do it there.

any suggestions on the best way (which program etc) to edit a screen, possibly on a win 10 computer?

?
?
Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...


(425) 791-0309
(707) 223-8212

------ Original Message ------
From: "Martin Connelly" <martin.at.leasingham@...>
Sent: 2/15/2020 1:23:12 AM
Subject: Re: [MachCNC] parts counter

[Edited Message Follows]

It sounds like the parts you are talking about are not using the 4th axis A. If you set A to zero at the start of your loop you can have a counter that increases by 1 at the end of the loop and moves A to that value. The A axis DRO will then act as a visible loop count.

Here is what I expect it to have added to the code:-

#111=[0] ; pick a suitable number for the subroutine counter
G0 A 0 ; set A to zero, if necessary you can put an M1 pause here to remind you if A has a large value to set zero and restart.

; call the subroutine

; end program

;? subroutine

#111=[#111 + 1]
G0 A [#111]

; return from subroutine

If you have not got the A axis set up then it should not be hard to set it up with a high speed to simulate it as required for this process.? If you are using A and are willing to modify the screen then use axis B and add the B axis DRO somewhere.

Martin


 

If you use the b axis you can see the count on the diagnostics screen. No need to add the DRO to a screen then.

Martin


 

great because i can't seem to get any screen editor to work. tried running in virtual box. i was ready to get the scale out which i might do anyway. i am ready to start making parts so i will check the diag screen.

?
?
Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...


(425) 791-0309
(707) 223-8212

------ Original Message ------
From: "Martin Connelly" <martin.at.leasingham@...>
Sent: 2/15/2020 12:10:50 PM
Subject: Re: [MachCNC] parts counter

If you use the b axis you can see the count on the diagnostics screen. No need to add the DRO to a screen then.

Martin


 

two question. i did get it to work with a simple test program putting all the code for the part in a sub and calling it a number of times. once i realized that the B axis was not enabled and i enabled it, it worked :)

how do i run a sub continuously instead of a fixed number of times???

it seems that the #111 variable needs to be initialized which is why i need a top level program and then a sub. if i don't use a sub and don't initialize the variable it does not work, program is constantly updating the B DRO.

so i guess i do need to put all the code in a sub, right? but how do i keep it running indefinitely until i stop the top program?

?
?
Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...


(425) 791-0309
(707) 223-8212

------ Original Message ------
From: "Martin Connelly" <martin.at.leasingham@...>
Sent: 2/15/2020 1:23:12 AM
Subject: Re: [MachCNC] parts counter

[Edited Message Follows]

It sounds like the parts you are talking about are not using the 4th axis A. If you set A to zero at the start of your loop you can have a counter that increases by 1 at the end of the loop and moves A to that value. The A axis DRO will then act as a visible loop count.

Here is what I expect it to have added to the code:-

#111=[0] ; pick a suitable number for the subroutine counter
G0 A 0 ; set A to zero, if necessary you can put an M1 pause here to remind you if A has a large value to set zero and restart.

; call the subroutine

; end program

;? subroutine

#111=[#111 + 1]
G0 A [#111]

; return from subroutine

If you have not got the A axis set up then it should not be hard to set it up with a high speed to simulate it as required for this process.? If you are using A and are willing to modify the screen then use axis B and add the B axis DRO somewhere.

Martin


 

no need to answer previous question about running indefinitely, i can just use a large number more than i would ever need and quit when done.

?
?
Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...


(425) 791-0309
(707) 223-8212

------ Original Message ------
Sent: 2/15/2020 1:27:25 PM
Subject: Re: [MachCNC] parts counter

two question. i did get it to work with a simple test program putting all the code for the part in a sub and calling it a number of times. once i realized that the B axis was not enabled and i enabled it, it worked :)

how do i run a sub continuously instead of a fixed number of times???

it seems that the #111 variable needs to be initialized which is why i need a top level program and then a sub. if i don't use a sub and don't initialize the variable it does not work, program is constantly updating the B DRO.

so i guess i do need to put all the code in a sub, right? but how do i keep it running indefinitely until i stop the top program?

?
?
Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...


(425) 791-0309
(707) 223-8212

------ Original Message ------
From: "Martin Connelly" <martin.at.leasingham@...>
Sent: 2/15/2020 1:23:12 AM
Subject: Re: [MachCNC] parts counter

[Edited Message Follows]

It sounds like the parts you are talking about are not using the 4th axis A. If you set A to zero at the start of your loop you can have a counter that increases by 1 at the end of the loop and moves A to that value. The A axis DRO will then act as a visible loop count.

Here is what I expect it to have added to the code:-

#111=[0] ; pick a suitable number for the subroutine counter
G0 A 0 ; set A to zero, if necessary you can put an M1 pause here to remind you if A has a large value to set zero and restart.

; call the subroutine

; end program

;? subroutine

#111=[#111 + 1]
G0 A [#111]

; return from subroutine

If you have not got the A axis set up then it should not be hard to set it up with a high speed to simulate it as required for this process.? If you are using A and are willing to modify the screen then use axis B and add the B axis DRO somewhere.

Martin


 

Sounds like you are heading to a solution. You can, if you want to, reset the value of the B axis to zero on the diagnostic screen just like a DRO. Another option to consider when coming up with a solution that works for you.

Martin


 

i got it working but still have one or two questions.

instead of using a variable that would expire with the program if i close it to edit it crashes for some reason. so instead i switch to relative distance then G0 B 1 and back to absolute? works great as long as mach3 doesn't get shut down

i tried the scale method and there is a problem with it at least with my scale. after a couple of minutes it goes into power saving mode because it was battery powered and pretty old technology. it has an AC supply but it still shuts down taking the reading with it.? i could work around this but the B DRO works great

the question:

i have 100 repeats of the sub. when the file is loaded, mach3 wants to calculate the tool path for all 100 iterations. is there some way to turn this off. i can just hit cancel but something more elegant might be nice. i don't see any option for this in general config.

also i would like to add a B DRO to my main screen but can not find an editor that works on win 10. before giving up and trying it on my XP machine with not great mouse etc (it is shop hardened mouse and keyboard) any suggestions to get it to work on win10? i tried virtual box and that did not work.?

also is there a manual for either screen editor. i did use them a while ago and figured it out but remember that they were not especially intuitive or friendly

?
?
Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...


(425) 791-0309
(707) 223-8212

------ Original Message ------
From: "Martin Connelly" <martin.at.leasingham@...>
Sent: 2/15/2020 12:10:50 PM
Subject: Re: [MachCNC] parts counter

If you use the b axis you can see the count on the diagnostics screen. No need to add the DRO to a screen then.

Martin


 

I’m pretty sure there is a six axis screen distributed with Mac3, try that it would save you trying to make a new screen.

Cheers

Calum

On 17 February 2020 at 13:31 "spencer@..." <spencer@...> wrote:

i got it working but still have one or two questions.

instead of using a variable that would expire with the program if i close it to edit it crashes for some reason. so instead i switch to relative distance then G0 B 1 and back to absolute? works great as long as mach3 doesn't get shut down

i tried the scale method and there is a problem with it at least with my scale. after a couple of minutes it goes into power saving mode because it was battery powered and pretty old technology. it has an AC supply but it still shuts down taking the reading with it.? i could work around this but the B DRO works great

the question:

i have 100 repeats of the sub. when the file is loaded, mach3 wants to calculate the tool path for all 100 iterations. is there some way to turn this off. i can just hit cancel but something more elegant might be nice. i don't see any option for this in general config.

also i would like to add a B DRO to my main screen but can not find an editor that works on win 10. before giving up and trying it on my XP machine with not great mouse etc (it is shop hardened mouse and keyboard) any suggestions to get it to work on win10? i tried virtual box and that did not work.?

also is there a manual for either screen editor. i did use them a while ago and figured it out but remember that they were not especially intuitive or friendly

?
?
Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...


(425) 791-0309
(707) 223-8212

------ Original Message ------
From: "Martin Connelly" < martin.at.leasingham@...>
Sent: 2/15/2020 12:10:50 PM
Subject: Re: [MachCNC] parts counter

If you use the b axis you can see the count on the diagnostics screen. No need to add the DRO to a screen then.

Martin


?


?


 

I have modified the standard screen set by adding a small B axis DRO to the first 3 screens. It can be downloaded from here.



Martin


 

Just spotted a toggle on the diagnostics screen for toolpath on/off. Turn it off for fast loading.

Martin


 

I was able to get the editor to work on win 10. Who knows, the 3 hour update that was forced on me might have fixed the fact that I think it did not work when I last tried it. I think the problem was that the floating pallet for the widget choosing did not display so nothing could be added. Now it is definitely there and it works. Other things changed with this update so several things I have used for years stopped. Every update they mess with MIDI some more and they remove unsigned drivers forcing you to reinstall them with driver signing turned off. So my scope stopped working again.?

If anyone is interested, I did find a site that explains how to turn of driver signing bullshit permanently and this actually stuck through the last update so i only had to re-install the driver and not go through "troubleshooting" startup and boot three times.

i have things on my main screen that i can't live without so i needed to add the B DRO to that as nice as other screens might be. I am making little wooden parts which vary a little in dimensions and squareness. I need to nudge the reference for each axis occasionally. I can't use a self centering vise because the parts are on an air vise on a 4th axis and no room for that. so i am stuck having to nudge every now and then.?

?
?
Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...


(425) 791-0309
(707) 223-8212

------ Original Message ------
From: "Martin Connelly" <martin.at.leasingham@...>
Sent: 2/17/2020 5:26:13 AM
Subject: Re: [MachCNC] parts counter

I have modified the standard screen set by adding a small B axis DRO to the first 3 screens. It can be downloaded from here.



Martin


 

thanks, never though of looking there.

?
?
Best regards, Spencer Chase
67550 Bell Springs Rd.
Garberville, CA 95542 Postal service only.
Laytonville, CA 95454 UPS only.
Spencer@...
Spencer@...
Spencer@...


(425) 791-0309
(707) 223-8212

------ Original Message ------
From: "Martin Connelly" <martin.at.leasingham@...>
Sent: 2/17/2020 8:15:01 AM
Subject: Re: [MachCNC] parts counter

Just spotted a toggle on the diagnostics screen for toolpath on/off. Turn it off for fast loading.

Martin


 

Spencer,

I use counters in my Mach3 program and have attached some jpg's of the macros and Mach3 modified screen.

I am using only the X & Z axis. It is actually a lathe running mach3 mill. The main screen has 3 counters using DRO's. The top one under the Z axis counts up the number of cycles run i.e. the number of parts made. It retains information during a shutdown of Mach3 and is reset by clicking the mouse on it and entering 0.

Since I am running a 6 ft 3/8" aluminum rod in the bar feeder to make 5/8" parts, I have the next counter down set at the number of counts left in the bar after it passes a switch before the headstock. This counter stops the lathe before the bar cannot be securely held in the collet and break a cutter.

The bottom counter just loads the number of cuts in the loop and decrements with each cut.

The 5 vars on the right are used to make minor adjustments to 5 things on the lathe per the wording on the spaces.

I have included a snapshot of my G Code so you can see when the Macros are called to set the counters.

Hope this helps,

Ross