Waiting for event (#WAIT FOR)
Syntax: |
#WAIT FOR <wait_condition> |
This command stops the decoding of the NC program until the arithmetical expression is fulfilled (TRUE or >0.5).
Programming Example
Waiting for an event
N10 #WAIT FOR V.E.EXT1 == 5 .... | ;NC program decidong ;is stopped at this point ;until the value of the external ;variable is 5. |
N50 #WAIT FOR V.E.EXT2 == TRUE .... | ;NC program decidong ;is stopped at this point ;until the value of the external ;variable is > 0.5. |
Notice | |
The controller look-ahead mechanisms may result is the state that a certain number of motion-relevant NC blocks programmed before #WAIT FOR are retained in the NC channel. If the retained motion blocks are relevant for generating the event itself, a deadlock is caused and execution of the NC program is stopped without any apparent reason. By programming #FLUSH or #FLUSH CONTINUE directly before #WAIT FOR, the execution of all preceding motion blocks is forced and a deadlock is avoided. |
Programming Example
Waiting for an event
.... | |
Nxx G01 X.. Y.. Z.. F.. | |
Nxx G01 X.. Y.. Z.. F.. | |
Nxx G01 X.. Y.. Z.. F.. | |
Nxx G01 X.. Y.. Z.. F.. | |
Nxx G01 X.. Y.. Z.. F.. | |
Nxx G01 X.. Y.. Z.. F.. | |
Nxx G01 X.. Y.. Z.. F.. | |
Nxx #FLUSH CONTINUE | ;Forced execution of all buffered motion blocks |
Nxx #WAIT FOR V.E.XX > 123 | ;Forced execution of all buffered motion blocks |
.... |