
SECTION
12. PROGRAM
CONTROL INSTRUCTIONS
A
delay of 0 means
that there is
no
delay
between
passes
through the loop. Each
time the
table is executed
all iterations
of
the loop will
be
completed
and execution
will
pass
on to the following
instructions.
lf
the delay is
5, every fifth
time
that
the
execution interval
comes
up, one
pass
through
the
loop
is made;
only those
instructions
in
the loop will
be executed and
other
portions
of the table
are not
executed
in
the
interim.
When
the loop
is
executed,
execution
starts at
the
loop,
skipping over
any
previous
instructions
in the
table.
When
a fixed number
of iterations
are executed,
the
time spent in
the loop is
equal to
the
product
of the execution interval,
delay,
and
the
number
of iterations. For
example,
a loop with a delay of
1
and a count
of 5 will
take 5 seconds
if
the
execution interval
is 1
second. When the loop is
first entered,
one
pass
through the loop
is
made,
then the 21X
delays untilthe next
execution
interval
and makes
the second
pass
through
the
loop.
After making
the fifth
pass
through the
loop,
there is the fifth
delay, after which
execution
passes
to
the
instruction
following the
END
instruction
which
goes
with
the loop.
While
in a loop with
delay,
the table will
not
be
initiated
at each execution interval.
(However,
the overrun
decimals will not
be displayed.)
Some consequences
of this
are: The
Output
Flag will
not
be automatically
cleared between
passes
through
the loop. Because
Table
2
cannot interrupt
Table 1, Table
2 will not be
executed while Table
1 is in
a
loop
with
delay.
Table
1 will not interrupt
Table
2 in the
middle
of
an
output array. Thus,
if the Output Flag is set in
Table
2
prior
to entering the loop
or within the
loop, the
flag
must
be specifically
cleared before
the end of the
pass
or Table 1
will not be able to
interrupt.
Input locations for
Processing
lnstructions within
a
loop can
be entered
as Indexed locations. An
Indexed location
causes the input
location to be
incremented by 1 with
each
pass
through the
loop.
(The
lndex counter
is added
to the
location number
in
the
program
table.)
lnput
locations which
are not indexed
will remain
constant.
To specify
an
Indexed location,
depress
the C
key
at some
point
while
keying in
the digits for
the input location and
before entering the
location with
the A
key.
Two dashes,
--,
appear
in
the two right
most
characters
of the display,
indicating
the entry
is lndexed.
When
the same output
processing
is requiied
values in
sequential
input locations,
it must
be
accomplished
by using
the repetitions
of the Output Instruction, not
by
indexing
the
input location within a loop.
An
Output Instruction
within
a loop is allotted
same number
of
Intermediate
Storage
locations
as it would receive if it were not in
the
loop.
For
example, the Average instruction with
a single
repetition is
allotted
only two Intermediate
locations:
one
for the number of samples
and
one for the running total. Each time through the
loop
the sample counter
is incremented
and the
value in the referenced
input
location is added
the total. lf the input
location is indexed,
the
values from
all
input
locations
are added to the
same total. lf the Average
instruction
with 1
repetition
and
location
1 indexed
is
placed
a loop of 10 and the Output
Flag
set high
prior
entering the loop, 10
values will
be output.
These will
not be the
averages for locations 1-
10. The first will
be
the average of all the
readings in
locations
1-10 since
the
previous
output. Because
the
Intermediate locations
are
zeroed each
time an
output occurs, the next
nine values will
be the
current values
(samples
at the time
of output)
of Locations 2-10.
Loops
can be nested.
Indexed locations within
nested
loops are indexed to the inner most loop
that
they are
within. The maximum nesting
in
the 21X is 9 deep.
This
applies to lf
Then/Else
comparisons and
Loops
or any
combination
thereof.
An
lf Then/Else
comparison which
uses
the Else lnstruction,
94
counts
as being
nested 2 deep.
PAR. DATA
NO. TYPE DESCRIPTION
2
Delay
4 lteration count
The
following example
involves
the use of the
Loop Instruction,
without a delay, to
perform
a
block data transformation.
01:
02:
12-2
Komentarze do niniejszej Instrukcji