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.
Notice
The P-STUP-00033 function must be parameterised in order to use it
Syntax: |
#OPTIONAL EXECUTION [ ON | OFF | CLEAR ] [ [SIMULATE] | [SIMULATE MASK=..] | [APPROACH] ] |
ON | Activate skipping |
OFF | Deactivate skipping |
| |
The syntax below is available as of CNC Build V3.3107.12 | |
| |
CLEAR | Every motion before this command is deleted. This ensures that, in the case of an Escape motion, no motion block can be executed by the Escape function before this flag. |
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. |
APPROACH | Implicitly flags the start and the end of the approach geometry in the Escape channel. This approach geometry is appended to the dynamically generated Escape path in the backward direction. The keyword can only be used for EDM and may only be programmed in the Escape channel. |
Therefore any interpolator state, especially the axis positions, must remain unchanged to prevent a discontinuous transition of path, velocity and acceleration.
Notice
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 or possibilities of M or H functions outside the sequence are described in [FCT-C7//”M/H function handshake with PLC“].
When the command #OPTIONAL EXECUTION [SIMULATE] ON/OFF 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.
Programing Example
Skipping program sequences
%t_storag.nc
X10 Y0
N10 G91 G00 X10 F1000
N11 #OPTIONAL EXECUTION ON
N12 Z123
N13 S1000 M3
N14 Z-123
N15 M101
N16 #OPTIONAL EXECUTION OFF
N20 G90 G01 X0
N30 G02 I10
N40 G03 J10
M30
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.
Notice
It is not practical to use the NC command #OPTIONAL EXECUTION together with contour-changing functions, e.g. tool radius compensation or polynomial contouring.
Programing 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.
N010 X10 Y0
N020 G91 G00 X10 F1000
N030 #OPTIONAL EXECUTION ON [SIMULATE MASK='2#000001']
N040 X20
N050 M3
N060 X0
N070 M101
N080 #OPTIONAL EXECUTION OFF
N090 #OPTIONAL EXECUTION ON [SIMULATE MASK='2#000010']
N100 X30
N110 M3
N120 X0
N130 M102
N140 #OPTIONAL EXECUTION OFF
N150 #OPTIONAL EXECUTION ON [SIMULATE MASK='2#000100']
N160 X40
N170 M3
N180 X0
N190 M103
N200 #OPTIONAL EXECUTION OFF
N210 X50
N220 X0
N230 M30