B&R – PLC – Structured Text – IF Statement

Syntax

IF <expression1> THEN

<statement_list1>

ELSIF <expression2> THEN

<statement_list2>
.
.

ELSIF <expressionN> THEN

<statement_listN>

ELSE

<statement_list>

END_IF;


Example

IF Var1 < 10 THEN

Var2 := 1;

ELSE

Var2 := 2;

END_IF;