Campbell Scientific CR10 CR10 Measurement and Control - Page 53

Program Control

Page 53 highlights

SECTION 3.INSTRUCTION SET BASICS The instructions to output the average temperature every 10 minutes are in Table 2 which has an execution interval of 10 seconds. The temperature will be measured 600 times in the 10 minute period, but the average will be the result of only 60 of those measurements because the instruction to average is executed only one tenth as.often as the instruction to make the measurement. lntermediate Processing can be disabled by setting Flag 9 which prevents Intermediate Processing without actually skipping over the Output Instruction (Section 1.2). All of the Output Processing lnstructions store processed data values when and only when the Output Flag is set (Section 1.2). The Output Flag (Flag 0) is set at desired interuals or in response to certain conditions by using an appropriate Program Control Instruction (Section 11). 3.7 USE OF FLAGS: OUTPUT AND PROGRAM CONTROL There are 10 flags which may be used in CR10 programs. Two of the flags are dedicated to specific functions: Flag 0 causes Output Processing Instructions to write to Final Storage, and Flag 9 disables intermediate processing. Flags 1-8 may be used as desired in programming the CR10. Flags 0 and 9 are automatically set low at the beginning of the program table. Flags 1-8 remain unchanged untilacted on by or until manually atogPgrolegdrafmromCothnetro*6l IMnsotrduec.tion TABLE 3.7-1. Flag Description Flag 0 Flag 1 to 8 Flag 9 - Output Flag - User Flags - IntermediateProcessing Disable Flaq Flags are set with Program Control Instructions. The Output Flag (Flag 0) and the intermediate programming disable flag (Flag 9) willalways be set low if the set high condition fails. The status of flags 1-8 does not change when a conditional test is false. 3.7.1 THE OUTPUT FLAG A group of processed data values is placed in Final Data Storage by Output Processing Instructions when the Output Flag (Flag 0) is set high. This group of data is called an Output Array. The Output Flag is set using Program Control Instructions according to time or event dependent interuals specified by the user. The Output Flag is set low at the beginning of each table. Output is most often desired at fixed intervals; this is acoomplished with Instruction 92, lf Time. Output is usually desired on the even interval, so Parameter 1, time into the interval, is 0. The time interval (Parameter 2), in minutes, is how often output will occur; i.e., the Output lnterval. The command code (Parameter 3) is 10, causing Flag 0 to be set high. The time interual is synchronized to 24 hour time; output will occur on each integer multiple of the Output Interualstarting from midnight (0 minutes). lf the Output lnterval is not an even divisor of 1440 minutes (24 hours), the last output interval of the day will be less than the specified time interval. Output will occur at midnight and will resume synchronized to the new day. Instruction 92 is followed in the program table by the Output Instructions which define the Output Array desired. Each group of Output Processing Instructions creating an Output Array is preceded by a Program Control Instruction that sets the Output Flag. NOTE: lf the Output Flag is already set high and the test condition of a subsequent Program Control lnstruction acting on Flag 0 fails, the flag is set low. This eliminates entering another instruction to specifically reset the Output Flag before proceeding to another group of Output lnstructions with a ditferent output interval. 3.7.2 THE INTERMEDIATE PROCESSING DISABLE FLAG The Intermediate Processing Disable Flag (Flag 9) suspends intermediate processing when it is set high. This flag is used to restrict sampling for averages, totals, maxima, minima, etc., to times when certain criteria are met. The flag is automatically set low at the beginning of the program table. 3-3

  • 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

The
instructions
to
output the average
temperature every
10 minutes
are
in
Table
2
which
has an
execution
interval
of
10
seconds.
The temperature
will
be measured 600
times
in
the
10
minute
period,
but
the
average
will
be
the
result of only 60
of
those
measurements
because
the
instruction
to
average
is
executed
only one
tenth
as.often as
the
instruction
to
make
the
measurement.
lntermediate
Processing
can
be disabled by
setting Flag
9
which prevents
Intermediate
Processing without actually skipping over
the
Output
Instruction
(Section
1.2).
All
of
the Output Processing
lnstructions store
processed data values when and only when
the
Output
Flag is set
(Section
1.2).
The
Output
Flag (Flag
0)
is
set at desired interuals or
in
response to certain conditions by using an
appropriate
Program
Control
Instruction
(Section
11).
3.7
USE
OF
FLAGS:
OUTPUT
AND
PROGRAM CONTROL
There
are
10
flags
which
may
be
used in CR10
programs. Two
of
the
flags
are dedicated
to
specific
functions:
Flag
0
causes
Output
Processing Instructions to write
to
Final
Storage,
and
Flag
9
disables
intermediate
processing.
Flags 1-8 may be used as desired
in programming
the
CR10.
Flags 0 and
9
are
automatically set low
at
the
beginning of the
program
table.
Flags 1-8 remain unchanged
untilacted
on by
a
Program
Control
Instruction
or
until manually toggled from
the
*6
Mode.
TABLE
3.7-1.
Flag
Description
SECTION
3.INSTRUCTION
SET
BASICS
3.7.1
THE OUTPUT FLAG
A
group
of
processed data
values
is placed
in
Final Data Storage by
Output
Processing
Instructions when
the Output
Flag (Flag
0)
is
set
high.
This group of
data
is
called
an
Output
Array.
The Output
Flag
is
set
using Program
Control
Instructions according to
time
or event
dependent interuals specified by
the
user.
The
Output
Flag
is
set
low
at
the
beginning of each
table.
Output
is most often desired
at
fixed
intervals;
this
is acoomplished
with
Instruction
92,
lf Time.
Output
is usually desired
on
the even
interval,
so Parameter
1,
time
into
the
interval, is
0.
The
time
interval (Parameter
2), in
minutes, is how
often output will
occur;
i.e.,
the Output
lnterval.
The
command
code
(Parameter
3) is
10,
causing
Flag
0
to
be
set
high.
The
time
interual
is synchronized to
24
hour
time;
output will
occur on
each integer
multiple
of
the
Output
Interualstarting from
midnight (0
minutes).
lf
the
Output lnterval
is not an even divisor of
1440 minutes (24 hours),
the
last
output
interval
of the day will be less than the specified
time
interval.
Output will occur
at
midnight and will
resume synchronized
to the
new day.
Instruction 92
is
followed
in
the
program table
by
the Output
Instructions which define
the
Output Array desired.
Each group of
Output Processing
Instructions
creating an Output Array is preceded by
a
Program
Control
Instruction that sets
the
Output
Flag.
NOTE:
lf
the Output
Flag is already set high
and the test condition of a
subsequent
Program
Control
lnstruction acting
on
Flag
0
fails, the
flag
is set
low.
This eliminates
entering
another
instruction to specifically
reset the
Output
Flag before
proceeding
to
another group of
Output
lnstructions
with
a
ditferent
output
interval.
3.7.2
THE INTERMEDIATE
PROCESSING
DISABLE FLAG
The
Intermediate Processing Disable Flag (Flag
9)
suspends
intermediate processing when it
is
set
high.
This
flag
is used
to
restrict sampling
for
averages,
totals,
maxima, minima, etc.,
to
times when certain
criteria are
met.
The
flag
is
automatically set low
at
the
beginning
of
the
program table.
Flag
0
Flag
1
to
8
Flag
9
-
Output
Flag
-
User Flags
-
IntermediateProcessing
Disable Flaq
Flags are set
with
Program
Control
Instructions.
The
Output
Flag (Flag 0) and
the
intermediate
programming disable
flag
(Flag 9)
willalways
be
set low
if
the
set high condition
fails.
The status
of
flags
1-8
does
not change when a conditional
test
is
false.
3-3