To count cycles on the machine, program: M30
To repeat the program or return from a subroutine, program: M99
To change a counter value explicitly, use a G10 command: G10 L99 P~ Q~
- P~ selects the cycle counter to change. Use any of the values detailed in the following table.
- Cycle Counter, P~
- M30 A, 0
- M30 B, 1
- M99 A, 2
- M99 B, 3
- Q~ specifies the value to set the cycle counter. If Q~ is omitted, the cycle counter is incremented by 1. For example, if you program G10 L99 P2, the M99 A cycle counter increments by 1
On the Main tab, the Tool Path display shows M30 and M99 cycle counters. They're useful to count parts completed during unattended operation.
For each M-code, there's an A and B counter. This provides more flexibility, because you can reset them to 0 independently. For example, you could use M30 A to count parts each shift, and M30 B to count parts each week. The cycle counters persist across the controller's power cycles.
In the MDI Line DRO field, type ADMIN CYCLECOUNTER to show or hide the counters and to reset them to 0.
The cycle counters are implemented as read-only persistent G-code numbered parameters, as detailed in the following table. If needed, the cycle counter value can be read in G-code.
Cycle Counter, Parameter
- M30 A, #5650
- M30 B, #5651
- M99 A, #5652
- M99 B, #5653