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.
Application
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
NC programs contained in this User's Manual are suggestions for solutions. The NC programs or individual NC blocks must be adapted before being used on a machine.
- Change the following contents as needed:
- Tools
- Cutting parameters
- Feed rates
- Clearance height or safe position
- Machine-specific positions, e.g. with M91
- Paths of program calls
Some NC programs depend on the machine kinematics. Adapt these NC programs to your machine kinematics before the first test run.
In addition, test the NC programs using the simulation before the actual program run.
With a program test you determine whether the NC program can be used with the available software options, the active machine kinematics and the current machine configuration.
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
NC programs contained in this User's Manual are suggestions for solutions. The NC programs or individual NC blocks must be adapted before being used on a machine.
- Change the following contents as needed:
- Tools
- Cutting parameters
- Feed rates
- Clearance height or safe position
- Machine-specific positions, e.g. with M91
- Paths of program calls
Some NC programs depend on the machine kinematics. Adapt these NC programs to your machine kinematics before the first test run.
In addition, test the NC programs using the simulation before the actual program run.
With a program test you determine whether the NC program can be used with the available software options, the active machine kinematics and the current machine configuration.
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 |