Waiting for an event

#WAIT FOR <expr>                                                                                                   (non-modal)

This command stops the decoding of the NC program until the arithmetic expression is fulfilled (TRUE or >0.5).

Programing Example

prg_example

Waiting for an event

N10 #WAIT FOR V.E.EXT1 == 5

(Decoding of NC program is stopped at this)

(point until the value of the external variable)

(is 5.)

....

N100 #WAIT FOR V.E.EXT2

(Decoding of the NC program is stopped at this

(Point until the value of the

(external variable > is 0.5.)

....

Attention

attention

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.

Programing Example

prg_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

....