omron — IF logical_expr THEN program instruction

IF logical_expr THEN program instruction 4. If there is an ELSE step, the second group of instruction steps is executed. 5. Program execution continues at the first step after the END step. The ELSE and END steps must be on lines by themselves as shown. There are no restrictions on the instructions that can be in either group in the structure. Thus, nested IF structures can be used. Examples Consider the following segment of a eV+ program. If the value of row is greater than 5, the expression row > 5 will be TRUE (-1.0), so step 22 is executed and 24 is not executed. Otherwise, step 22 is not executed, but step 24 is executed:

21 IF row > 5 THEN 22 spacing = 10 23 ELSE 24 spacing = 20 25 END The next program segment determines whether the variable input.signal has been defined. If it has, the program checks the signal indicated by the value of input.signal and types different messages depending on its setting. Note that the outer IF does not include an ELSE clause: 71 IF DEFINED(input.signal) THEN 72 IF SIG(input.signal) THEN 73 TYPE "The input signal is ON" 74 ELSE 75 TYPE "The input signal is OFF" 76 END 77 END Refer to the DEFINED function for details on testing nonreal arguments. Related Keywords CASE program instruction DEFINED real-valued function ELSE program instruction IF...

GOTO program instruction eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 290