Nesting IF staztements

I am having trouble putting together IF statements when the conditionals being evaluated are not exclusively ORed together or ANDed together. The specific syntax is:

IF (override = .FALSE.) .AND.
(((LEVEL < THRESHOLD)) .OR.
((LEVEL > THRESHOLD) .AND. (SWITCH==.FALSE.)))
Then …

In order to evaluate as true the override has to be disabled and one of the two following conditions must be true. Either the level is less than the threshold or the level is greater than the threshold and the switch is OFF.

Any help would be appreciated.

Conditionals which combine AND/OR logic currently require nesting the IF conditions:

IF (override == FALSE)
THEN
   IF LEVEL < THRESHOLD
   THEN
        Do Action

   IF (LEVEL > THRESHOLD) AND (SWITCH == FALSE)
   THEN 
      Do Action

@James feel free to correct me if there’s a better alternative approach.

1 Like

Thanks Josh for the quick response. I’m a bit confused. When I’m in the Rule Engine and bring up an “IF” statement I’m limited to clicking on the predefined choices (device, mode, variable, etc.). Your response appears to be typed within an editor and not built by clicking on the pre-defined options.

I’m guessing I’m missing some major piece! :dizzy_face:

@Marc_Orlick, you can add nested IF_Conditions in the THEN and/or ELSE paths, not within the IF_Condition’s comparison section. See the screenshot below.

Fantastic!! I’ll give it a try