Campbell Scientific CR10 CR10 Measurement and Control - Page 158

NUMBER, loop., table., total.

Page 158 highlights

SECTION 12. PROGRAM CONTROL INSTRUCTIONS PARAM. DATA NUMBER ryPE 01: 2 DESCRIPTION Subroutine number (1-9, 79-99) *** g6 DO *** FUNCTION This Instruction unconditionally executes the specified command. PARAM. DATA NUMBER TYPE DESCRIPTION 01: 2 Command (Table 12-2) *** 87 LOOP *** FUNCTION Instructions included between the Loop Instruction and the End lnstruction (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. Its units are multiples of the table execution interval. 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 a loop with delay is executed. the next execution stafts at the loop, skipping over any previous and following instructions in the table. When a fixed number of iterations are executed, the time spent in the loop is equalto 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 CR10 delays untilthe next execution intervaland makes the second pass through the loop. After making the fifth pass through the loop, there is the fifth delay, 12-2 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 an output array. Thus, if the Output Flag is set in Table 2prior to enteringthe loop orwithin the loop, the flag must be specifically cleared ,the end of the pass if Table 1 is to be executed. Input locations for Processing lnstructions 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 Index counter is added to the location number in the program table.) Input 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 Indexed. When the same output processing is required on values in sequential input locations, it must be accomplished by using the repetitions parameter of the Output lnstruction, not by indexing the input location within a loop. An Output Instruction within a loop is allotted the 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 to the total. lf the input location is indexed, the values from all input locations are added to the same total. Note that if the Output Flag is set prior to entering the loop in the above example, 10 values will be output. The first will be the

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • 236
  • 237
  • 238

SECTION
12. PROGRAM
CONTROL
INSTRUCTIONS
PARAM.
DATA
NUMBER
ryPE
01:
2
DESCRIPTION
Subroutine number
(1-9, 79-99)
***
g6
DO
***
FUNCTION
This
Instruction unconditionally executes the
specified command.
PARAM.
DATA
NUMBER
TYPE
DESCRIPTION
2
Command
(Table
12-2)
***
87
LOOP
***
FUNCTION
Instructions included between
the
Loop
Instruction and
the
End lnstruction (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.
Its units are multiples
of
the
table
execution
interval.
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
a
loop with delay
is
executed.
the
next execution
stafts
at
the
loop, skipping over any previous and following
instructions
in
the table.
When
a
fixed
number
of
iterations are
executed, the
time
spent
in
the
loop
is
equalto
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 CR10 delays
untilthe
next
execution intervaland
makes the second
pass through
the
loop.
After
making the fifth
pass through
the
loop,
there
is
the fifth delay,
12-2
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
an output array.
Thus,
if
the
Output
Flag
is
set
in
Table
2prior
to
enteringthe
loop
orwithin
the
loop, the
flag
must be specifically cleared
,the
end of the pass
if
Table
1 is
to
be executed.
Input locations
for
Processing lnstructions
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 Index counter is added to
the
location number
in
the
program
table.)
Input
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 Indexed.
When the same output processing is required
on values in sequential input locations, it must
be accomplished by using
the
repetitions
parameter
of
the
Output
lnstruction, not by
indexing
the
input location within a loop.
An
Output
Instruction within
a
loop
is
allotted
the
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
to the
total.
lf
the
input location is indexed, the
values from
all
input locations are added to the
same total.
Note that
if
the Output Flag
is
set prior to
entering
the
loop
in
the above
example,
10
values will be
output.
The first will
be
the
01: