Manual

12-1
SECTION 12. PROGRAM CONTROL INSTRUCTIONS
TABLE 12-1. Flag Description
Flag 0 Output Flag
Flag 1 to 8 User Flags
Flag 9 Intermediate Processing Disable
Flag
TABLE 12-2. Port Command Codes
0 - Go to end of program table
1-9, 79-99 - Call Subroutine 1-9, 79-99
10-19 - Set Flag 0-9 high
20-29 - Set Flag 0-9 low
30 - Then Do
31 - Exit loop if true
32 - Exit loop if false
41-48* - Set port 1 - 8 high
51-58* - Set port 1 - 8 low
61-68* - Toggle port 1 - 8
71-78* - Pulse port 1 - 8 100 ms
* The port commands operate on excitation card
1 or on the excitation card set active by
Instruction 20.
*** 83 IF CASE X < F ***
FUNCTION
Instruction 83 tests the value in an input location
specified in the Begin Case Instruction 93. A
series of Instructions 83 are used to compare
the value in the input location to ever increasing
fixed values. If the value in the location is less
than the fixed value entered as Parameter 1,
then the command in Parameter 2 is executed
and when the next Instruction 83 is encountered
execution branches to the end of the case
statement. If the fixed value is less, the next
Instruction 83 is executed. See Instruction 93
for an example.
PAR. DATA
NO. TYPE DESCRIPTION
01: FP Fixed value
02: 2 Command (Table 12-2)
*** 85 LABEL SUBROUTINE ***
FUNCTION
This instruction marks the start of a subroutine.
A subroutine is a series of instructions
beginning with Instruction 85 and terminated
with Instruction 95, END. All subroutines must
be placed in Table 3 (Subroutine Table). When
a subroutine is called by a command in a
Program Control Instruction, the subroutine is
executed, then program flow continues with the
instruction following that which called the
subroutine.
Subroutines cannot be embedded within other
subroutines; a subroutine must end before the
next one begins. Subroutines may be called
from within other subroutines (nested). The
maximum nesting level for subroutines is 7
deep. Attempts to nest more than 7 deep will
not be detected at compilation, but will result in
a run time error. When the seventh subroutine
attempts to call the eighth, error 31 will be
displayed. Execution will not branch to the
eighth subroutine; it will continue with the
Instruction following that calling the subroutine.
PAR. DATA
NO. TYPE DESCRIPTION
01: 2 Subroutine number (1-9, 79-99)
*** 86 DO ***
FUNCTION
This instruction unconditionally executes the
specified command.
PAR. DATA
NO. TYPE DESCRIPTION
01: 2 Command (Table 12-2)
*** 87 LOOP ***
FUNCTION
Instructions included between the Loop
Instruction and the End Instruction (95) are
repeated the number of times specified by the
iteration count (Parameter 2), or until an Exit
Loop command (31, 32) is executed by a
Program Control Instruction within the Loop. If