The FUNCTION COUNT function allows you to control a simple counter from within the NC program. For example, this function allows you to count the number of manufactured workpieces.
Application
Description of function
The count is retained even 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 value of the counter to 5 |
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 function provides the following possibilities:
Syntax | Function |
---|---|
INC | Increase count by 1 |
RESET | Reset counter |
ADD | Increment the counter by the desired value Input: 0...9999 |
SET | Set the counter to the desired value Input: 0...9999 |
TARGET | Set the nominal count (target value) to the desired value Input: 0...9999 |
REPEAT | Repeat the NC program from the defined label if the target value has not yet been reached. 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 use Cycle 225 to engrave the current counter value into the workpiece.
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 | ; Set target number of machining operations |
13 LBL 11 | ; Jump label |
* - ... | ; Machining operation |
21 FUNCTION COUNT INC | ; Increase counter value |
22 FUNCTION COUNT REPEAT LBL 11 | ; Repeat machining operation if the target number has not been reached |
23 M30 | |
24 END PGM |