Defining counters with FUNCTION COUNT
Application
With the FUNCTION COUNT NC function, you control a counter from within the NC program. This counter allows you, for example, to define a target count up to which the control is to repeat the NC program.
Description of function
The counter reading remains the same after a restart of the control.
The control only takes the FUNCTION COUNT function into account in the Program Run operating mode.
The control shows the current counter value and the defined target number on the PGM tab of the Status workspace.
Input
11 FUNCTION COUNT TARGET5 | ; Set the target count of the counter to 5 |
Insert NC function All functions FN FUNCTION COUNT
The NC function includes the following syntax elements:
Syntax element | Meaning |
---|---|
FUNCTION COUNT | Syntax initiator for the counter |
INC, RESET, ADD, SET, TARGET or REPEAT | Define counting function |
Counting functions
The FUNCTION COUNT NC function provides the following counter functions:
Syntax | Function |
---|---|
INC | Increase the counter by 1 |
RESET | Reset the counter |
ADD | Increase the counter by a defined value Fixed or variable number or name Input: 0...9999 |
SET | Assign a defined value to the counter Fixed or variable number or name Input: 0...9999 |
TARGET | Define the target count to be reached Fixed or variable number or name Input: 0...9999 |
REPEAT | Repeat the NC program from the label if the defined target count has not been reached yet Fixed or variable number or name |
Notes
- Please check prior to machining whether a counter is active.
- The machine manufacturer uses the optional machine parameter CfgNcCounter (no. 129100) to define whether you can edit the counter.
- You can engrave the current counter reading with Cycle 225 ENGRAVING.
Example
11 FUNCTION COUNT RESET | ; Reset counter value |
12 FUNCTION COUNT TARGET10 | ; Define the target count of machining operations |
13 LBL 11 | ; Set a jump label |
* - ... | ; Execute the machining operation |
21 FUNCTION COUNT INC | ; Increase the counter reading by 1 |
22 FUNCTION COUNT REPEAT LBL 11 | ; Repeat the machining operation until the target count has been reached |