Combination of $IF conditions with and without frequency

Notice

notice

$IF conditions with and without specified frequency can be nested in one another. In this case, ensure that instructions can only be executed when they are actually reached.

For example, a single activation of an ALWAYS block does not result in its instructions being executed in all the following CNC cycles. You can use a higher-level $IF condition to prevent this if the result is negative.

If V.E.CONDITION is true in the following NC program and then V.E.VALUE > 100, the ALWAYS block runs through. However, this only applies as long as V.E.CONDITION has the value 1.

Programing Example

prg_example

Nested $IF conditions

; Define realtime cycle

#RT CYCLE [SCOPE = PROG]

  ; external condition

  $IF V.E.CONDITION == 1

    ; ALWAYS block

    $IF ALWAYS V.E.VALUE > 100

      ; ALWAYS instructions

      ; ...

    $ENDIF

  $ENDIF

#RT CYCLE END

; ...

; End main program

M30