Advanced controlling of program loops

Aborting program loops with BREAK

Application

You can use the BREAK NC function to abort a program loop (e.g., if a certain machine or tool status occurs).

Description of function

If the control executes the BREAK NC function, it aborts the program loop. The control skips the NC blocks until the footer and then executes the rest of the NC program.

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.

 
Tip

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 FOR Q50 = 4 TO 10

; Header of the FOR loop

         * - ...

15 IF Q182 == +1

; Workpiece status: scrap after probing

16 BREAK

; If Q182 contains the value 1, the control will execute this NC block contains and then abort the program loop

17 END IF

         * - ...

21 END FOR

; Footer of the FOR loop

To navigate to this function:

Insert NC function All functions FN Program section repeat BREAK

The NC function includes the following syntax elements:

Syntax element

Meaning

BREAK

Syntax initiator for aborting the program loop

Note

Program a BREAK only in combination with a case analysis. That way the control will abort the program loop only in the defined case.

Case analyses

Canceling program loops with CONTINUE

Application

You can use the CONTINUE NC function to skip the current repetition of a program loop. The control then continues with the subsequent program loop.

Description of function

If the control executes the CONTINUE NC function, it cancels the current loop repetition. The control skips the NC blocks up to the footer, ignoring the rest of the program loop. The control then executes the next loop repetition.

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.

 
Tip

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 FOR Q50 = 4 TO 10

; Header of the FOR loop

         * - ...

15 IF Q182 == +1

; Workpiece status: scrap after probing

16 CONTINUE

; If Q182 contains the value 1, the control will execute this NC block contains and then cancel the current loop repetition

17 END IF

    * - ...

21 END FOR

; Footer of the FOR loop

To navigate to this function:

Insert NC function All functions FN Program section repeat CONTINUE

The NC function includes the following syntax elements:

Syntax element

Meaning

CONTINUE

Syntax initiator for canceling a loop repetition