7 use of flags: output and program control, 1 the output flag – Campbell Scientific CR7 Measurement and Control System User Manual

Page 45

Advertising
background image

SECTION 3. INSTRUCTION SET BASICS

3-3

sample counts, stores the resulting average in
Final Storage and zeros the value in
Intermediate Storage so that the process starts
over with the next execution.

Final Storage is the default destination of data
output by Output Processing Instructions
(Sections OV2, 1.5, 2.1). Instruction 80 may be
used to direct output to Input Storage or to Final
Storage.

Output Processing Instructions requiring
intermediate processing sample the specified
input location(s) each time the Output
Instruction is executed, NOT necessarily each
time the location value is updated by an I/O
Instruction. For example: Suppose a
temperature measurement is initiated by Table
1 which has an execution interval of one
second. 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.

Final processing occurs only when the Output
Flag is set (Section 3.7.1). The Output Flag,
Flag 0, is set at desired intervals or in response
to specified 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 CR7
programs. Two of the flags have functions with
Output Processing Instructions: Flag 0 controls
final processing and data storage, and Flag 9
can disable intermediate processing. Flags 1-8
may be used as desired in programming the
CR7. Flags 0 and 9 are automatically set low at
the beginning of the program table. Flags 1-8
remain unchanged until acted on by a Program
Control Instruction or until manually toggled
from the *6 Mode.

TABLE 3.7-1. Flag Description

Flag 0

- Output Flag

Flag 1 to 8 - User Flags
Flag 9

- Intermediate Processing Disable

Flag

Flags are set with Program Control Instructions.
The Output Flag, Flag 0, and the intermediate
processing disable flag, Flag 9, will always be
set low if the set high condition is not met. The
status of flags 1-8 are not changed if a
conditional test is false.

3.7.1 THE OUTPUT FLAG

A set of processed data values is placed in
Final Storage by Output Processing Instructions
when the Output Flag, Flag 0, is set high. This
set of data is called an output array. The
Output Flag is set according to time or event
dependent intervals using Program Control
Instructions specified by the user. The Output
Flag is set low at the beginning of each table.

Each group of Output Processing Instructions
creating an output array must be preceded by a
Program Control Instruction that sets the Output
Flag.

Output is most often desired at fixed intervals;
this is accomplished with Instruction 92, If Time,
which checks the clock to see if it is X minutes
into a Y minute interval. If the time condition is
met, a command is executed. Output at the
beginning of the interval by making Parameter
1, time into the interval, 0. Parameter 2, the
time interval in minutes, is how often output will
occur; i.e., the Output Interval. Enter 10 for
parameter 3, the command code, to set Flag 0
high. Instruction 92 is followed in the program
table by the Output Instructions which define the
output array desired.

The time interval is synchronized to 24 hour
time; output will occur on each integer multiple
of the Output Interval starting from midnight (0
minutes). If the Output Interval 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.

Advertising