F8 – if (conditional) – Rockwell Automation 2708-NAG Application Generation Software User Manual

Page 29

Advertising
background image

Chapter 3
Using Application Generator

3 – 19

F8 – IF (Conditional)

An IF statement is another way of changing the order or program execution.
It allows you to GOTO a statement IF a variable is in some state.

When

F8 – IF

is chosen you are asked for the Variable to compare. Then the

Main Operations Menu is replaced with this sub-menu:

Figure 3.20
AG Conditionals (IF) Menu

In

F2

through

F5

, you are prompted with “Value (text in quotes) or Variable

name to compare : ”. For example, you might have entered

IN

as the variable

to compare immediately after pressing

F8

, then after you chose

F4

(If less

than ..) you might enter 9999, if you want to be sure the number that was
input into the IN variable was less than 9999. Then you are prompted to enter
the GOTO statement number if your compare is true. You can enter the
number or use the up/down arrows to find the statement and press enter.

In

F6

and

F7

, you are prompted to enter both the lower limit and the upper

limit of the range. Then you are prompted to enter the GOTO statement
number if your compare is true. You can enter the number or use the
up/down arrows to find the statement and press enter.

In

F8

and

F9

the ‘starts with’ and ‘ends with’ are used to branch (GOTO) if

the variable starts or ends with some piece of text. You will usually type
quotation marks (“) in front of the text being checked.

After you have entered the compare data, (text as above, a numeric, or
another variable), you are prompted to enter the GOTO statement number if
your compare is true. You can enter the number or use the up/down arrows to
find the statement and press

[ENTER]

.

Advertising