Every step of a Program block contains at least one command. Each command is made up of the command keyword (for example SETOUT or MAXWAIT) and zero or more command arguments. You can use values or expressions as command arguments.
Values
Values are either a constant number or a block name. Numbers can be positive or negative integers or floating point values. A block name is the name of any block within the process database. Most commands are used in conjunction with a block.
Expressions
Expressions compare values in the IF and WAITFOR commands. An expression has the syntax:
operand1RelationalOperatoroperand2
Operand1 can be:
Operand1 |
Example |
A block name |
AGITSTART |
TIME, DATE, or DAY (must be used with a constant) |
IF TIME = 12:00:00 GOTO 05 |
OPEN/CLOSE register:bit |
OPEN 23:14 |
Operand2 can be:
Operand2 |
Example |
Floating-point or integer values |
SETOUT AI1 34.56 |
OPEN/CLOSE |
WAITFOR DI1=OPEN |
A block name |
AGITSTART |
MM-DD-YY, SUN, MON, TUE, WED, THU, FRI, SAT, or HH:MM:SS for TIME, DATE, and DAY operands only. International time formats are also accepted. |
IF DAY = FRI GOTO 08 |
All relational operators are legal for floating-point and integer values. However other values, such as day of the week, are restricted to = (Equals) and != (Not equal). Supported relational operators described in the following table.
Operator |
Function |
> |
Greater than |
< |
Less than |
<= |
Less than or equal to |
>= |
Greater than or equal to |
!= |
Not equal |
= |
Equals |
NOTE: When using the IF or WAITFOR commands to compare values, consider using the SETLIM command to create a limit of precision for the comparison. In some cases, 10 might not equal 10, since the block might really be comparing 10.0001 to 10.0003. The SETLIM command lets you assign an inclusion limit for the comparison, such as +/-0.1. Please refer to the SETLIM command for more information.