omron — IF logical_expr THEN program instruction

IF logical_expr THEN program instruction IF logical_expr THEN program instruction Syntax IF logical_expr THEN ELSE first steps second steps END Function Conditionally execute a group of instructions (or one of two groups) depending on the result of a logical expression. Usage Considerations There must be a matching END statement for every IF... THEN in a program. Parameters logical_expr Real-valued expression whose value is tested for TRUE (nonzero) or FALSE (zero). first_steps Optional group of program instructions that are executed only if the value of the logical expression is TRUE (nonzero).

second_steps Optional group of program instructions that are executed only if the value of the logical expression is FALSE (zero). The ELSE statement may be omitted if there are no steps in this group. Details This control structure provides a means for conditionally executing one of two groups of instructions. In detail, it is processed as follows: 1. logical_expr is evaluated. If the result is FALSE (zero), skip to item 4 below. 2. The first group of instruction steps is executed. 3. Skip to item 5 below. eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 289