Skipping program sequences (#OPTIONAL EXECUTION)
In the NC program, the programming command #OPTIONAL EXECUTION ON/OFF flags a sequence that is to be skipped during backward motion or simulate motion.
Skipping is activated in the PLC. The flagged program part is skipped if
- backward motion is active (backward motion control unit)
- or with simulated (“simulate motion” control unit)
The flagged area is then skipped at interpolator level. However, transition conditions between blocks before and after the skipped area are not recalculated.
![]() | The P-STUP-00033 function must be parameterised in order to use it |
Syntax : |
#OPTIONAL EXECUTION [ [ON] [ [ SIMULATE | SIMULATE MASK=.. ] ] ] | OFF |
ON | Activate skipping |
OFF | Deactivate skipping |
The syntax below is available as of CNC Build V3.3107.12 | |
SIMULATE | The programmed sequence between #OPTIONAL EXECUTION ON and OFF is only skipped if the signal of the “simulate motion” control unit is active. |
SIMULATE MASK=.. | 64-bit mask for the specification. The sequence between #OPTIONAL EXECUTION ON and OFF is only skipoped if the signal of the ”simulate motion” control unit is active and the programmed mask has bitwise matches with the “simulate motion mask” control unit. |
Therefore any interpolator state, especially the axis positions, must remain unchanged to prevent a discontinuous transition of path, velocity and acceleration.
![]() | Axis positions must be identical before and after the skipped sequence. If axis position are changed the error message ID 50452 is output. |
Synchronisation of M/H functions with #OPTIONAL EXECUTION
The sequences flagged with #OPTIONAL EXECUTION ON/OFF are only skipped if backward motion or “simulate motion” are active. No M/H functions are output.
The behaviour/options with M or H functions outside the sequence are described in [FCT-C7//„M/H function handshake with the PLC“]
When the command #OPTIONAL EXECUTION ON [SIMULATE] is used, the “simulate motion” control unit must be active in order to skip the sequence. Therefore, skipping the sequence with backward motion requires backward motion and “simulate motion” to be active.
Programming Example
Skipping program sequences
The CNC checks and monitors only the continuous path of axes whether blocks are skipped or not. Any further conditions must be ensured by the user itself and are not checked by the CNC.
Nesting of multiple commands optional execution on/off is not considered.
Before terminating the program level (M17, M29) where OPTIONAL EXECUTION was selected (ON), the function must also be deselected (OFF). This also applies to terminating the main program level (M30). If the program level is terminated without deselection of the function, the error ID 21719 is output.
It is only possible to terminate complete section. If backward motion or “simuate motion” are activated when the program is executed within an OPTIONAL_EXECUTION section, the section is not skipped.
![]() | It is not practical to use the NC command #OPTIONAL EXECUTION together with contour-changing functions, e.g. tool radius compensation or polynomial contouring. |
Programming Example
Skipping program sequences with “SIMULATE MASK”
In the NC program below, 3 skipped sequences are flagged and are each provided with an identifier in the form of a binary bitmask. These sequences are only skipped when the “simulate motion” control unit is active and also when the programmed mask has bitwise matches with the “simulate motion mask” control unit.