de:s7:scl_reference_program_control

Simatic S7 SCL reference: Program control operations

Back to reference overview: Simatic S7 SCL reference with examples

The instruction Run conditionally branches the program flow depending on a condition. The condition is an expression with Boolean value (TRUE or FALSE). Logical expression or comparative expressions can be stated as conditions.

The simplest lineup is when the branch consists of only one query:

IF <condition> THEN 
   <instructions>
END_IF;

IF (simple)

For a more complex lineup, a else branch is added to the branch:

IF <condition> THEN 
   <instructions1>
ELSE 
   <Instructions0>
END_IF;

IF (with "else")

The composite branch, when one or more additional IF branches are embedded in the IF block, with ELSE branches:

IF <condition1> THEN 
   <instructions1>
ELSIF <condition2> THEN 
      <instruction2>
ELSE 
      <Instructions0>
END_IF;

IF (with "elsif")

  • de/s7/scl_reference_program_control.txt
  • 2022/04/21 19:15
  • sndvmo