Combination of $IF conditions with and without frequency

$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.

Programming 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