Stop on CNC Parts Count

Sat, Jun 5, 2010

FAQs, G-Code, Programming

Dear Answer Man,

We are using a bar puller on a job that I am running, and I would like the machine to stop after a certain number of parts. Can you assist me in doing this?

Bob Knight

Dear Bob:

There are a couple of ways to specify the number of machining cycles you would like to run. One of the simplest is by using a sub-program, with an M98 Pnnnn that calls up a program from your list of programs. Another way is to use a sub-routine, with an M97 Pnnnn that calls up a block of code that starts with a sequence number located after an M30. With either M97 or M98, you can specify an Lnn count command for the number of times you would like to repeat the sub.

A program using an M98 would look something like this:

%

O01201 (Sub-program call with M98 and looping it 10 times)

M98 P1202 L10 (Calling sub-program O1202 and repeating it 10 times)

M30 (End of program command)

%

%

O1202 (Sub-program called by an M98 P1202

repeating it 10 times with L10)

N1 (Sub-program tool path)

N2 ( ” ” ” ” )

N3 ( ” ” ” ” )

M99 (Loops back to line after M98)

%

A program using an M97 would look something like this:

%

O01203

M97 P101 L8 (Calling a local sub-routine with

an M97 P101 repeating it 8 times)

M30 (End of program command)

N101 (Local sub-routine called by an M97 P101)

N102 (Sub-routine tool path)

N103 (” ” ” ” )

N104 M99 (Loops back to line after the M97)

%

Another simple way to specify the number of machine cycles for a part is by using the TOOL LIFE page in CURNT COMDS. Enter the number of times you want to run a part in the ALARM column of tool #1. When the USAGE reaches the ALARM number for the desired number of cycles, the machine will stop. You can zero these numbers by pressing ORIGIN.

Sincerely, Answer Man

|| More
, ,