Campbell 21X Operator's Manual page 129

Micrologger
Table of Contents

Advertisement

N
12.
PROGRAM CONTROL INSTRUCTIONS
Flag
0
Flag
1
to
8
Flag
9
12-1.
Flag
Description
Output Flag
User Flags
I
ntermediate Processing Disable
Flag
Instruction
95, END.
Allsubroutines
must
be
placed
in
Table 3 (Subroutine Table). When
a
subroutine
is
called by
a
command
in
a Program
Control Instruction, the subroutine is execuled,
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
callthe
eighth, error 31
will
be
displayed.
Execution will not branch to
the
eighth subroutine;
it
will continue with
the
lnstruction following that calling the subroutine.
PAR.
DATA
NO.
TYPE
DESCRIPTION
01
:
2
Subroutine
number (1-9, 77-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
lnstruction 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.
lf
0
is
entered for
the count, the loop is repeated
until
an Exit Loop command is executed.
The
first parameter, delay, controls how
frequently passes through the loop are made.
The
delay unit
is
the
table execution interval:
TABILE
12-2. Command Codes
0-
1-9,
77-99
1
0-tr9
20-49
g0
31
32
41-46
51-q6
61
Go to end of program table
Call Subroutine
1
-9, 77-99
Set Flag 0-9 high
Set Flag
0-9low
Then Do
Exit loop
if
true
Exit loop
if
false
Setport1-6high
Setportl-6low
Toggleport1-6
the
fixed value is less, the next
is
executed. See
lnstruction 93
71-
g3
lFcAsE
x<F
*"*
FUNCTION
lnstruction
tests
the value in an input location
specified
in
Begin
Case Instruction
93.
A
series of
ions 83
are used to compare
the
value
in
input location to
ever increasing
fixed
lf
the
value
in
the location is less
value
entered as Parameter
1,
than
the
then
the
mand in Parameter
2
is
executed
and when
execution
next Instruction
83
is
encountered
to
the end
of
the case
statement.
lnstruction
01:
02:
for an
PARAM.
NUMBER
DESCRIPTION
Fixed value
Command
*** 85
LABEL SUBROUTINE
This instruc{on marks the start of a subroutine.
A subroutind is a series of instructions beginning
FP
2
with Instructlon 85 and terminated with
12-1

Advertisement

Table of Contents
loading

Table of Contents