Chapter 8. Structured Text (ST) Programming374 PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual GFK-2950C8.2.4 IF StatementThe IF construct offers conditional execution of a statement list. The condition is determined byresult of a Boolean expression. The IF construct includes two optional parts, ELSE and ELSIF, thatprovide conditional execution of alternate statement list(s). One ELSE and any number of ELSIFsections are allowed per IF construct.FormatIF BooleanExpression1 THENStatementList1;[ELSIF BooleanExpression2 THEN (*Optional*)StatementList2;][ELSE (*Optional*)StatementList3;]END_IF;Where:BooleanExpression Any expression that resolves to a Boolean value.StatementList Any set of structured text statements.Note: Either ELSIF or ELSEIF can be used for the else if clause in an IF statement.OperationThe following sequence of evaluation occurs if both optional parts are present:■ If BooleanExpression1 is TRUE (1), StatementList1 is executed. Program execution continueswith the statement following the END_IF keyword.■ If BooleanExpression1 is FALSE (0) and BooleanExpression2 is TRUE (1), StatmentList2 isexecuted. Program execution continues with the statement following the END_IF keyword.■ If both Boolean expressions are FALSE (0), StatmentList3 is executed. Program executioncontinues with the statement following the END_IF keyword.If an optional part is not present, program execution continues with the statement following theEND_IF keyword.ExampleThe following code fragment puts text into the variable Status, depending on the value of I/O pointinput value.IF Input01 < 10.0 THENStatus := Low_Limit_Warning;ELSIF Input02 > 90.0 THENStatus := Upper_Limit_Warning;ELSEStatus := Limits_OK;END_IF;