开云体育

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

Re: parts counter


 

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

Join [email protected] to automatically receive all group messages.