2 subroutines, 3 table priority/interrupts, 4 *4 parameter entry table – Campbell Scientific CR23X Micrologger User Manual
Page 36

SECTION 1. FUNCTIONAL MODES
1-2
1.1.2 SUBROUTINES
Table 3 is used to enter subroutines which may
be called with Program Control Instructions in
Tables 1 and 2 or other subroutines. The group
of instructions which form a subroutine must
begin with Instruction 85, Label Subroutine, and
end with Instruction 95, End (Section 12).
Subroutines 95, 96, 97, and 98 have the unique
capability of being executed when a port goes
high (ports 5, 6, 7, and 8 respectively). Any of
these subroutines will interrupt Tables 1 and 2
(Section 1.1.3) when the appropriate port goes
high. When the port goes high, the processor
awakes within a few microseconds. The port
triggers on the rising edge (i.e., when it goes
from low to high). If the port stays high, the
subroutine is not called again.
1.1.3 TABLE PRIORITY/INTERRUPTS
Table 1 execution has priority over Table 2. If
Table 2 is being executed when it is time to
execute Table 1, Table 2 will be interrupted.
After Table 1 processing is completed, Table 2
processing resumes at the interruption point. If
the execution interval of Table 2 coincides with
Table 1, Table 1 is executed first, then Table 2.
Interrupts by Table 1 are not allowed in the
middle of an instruction or while output to Final
Storage is in process (flag 0 is set high). The
interrupt occurs as soon as the instruction is
completed or flag 0 is set low.
Special subroutines 95, 96, 97, and 98, initiated
by a port going high (Section 1.1.2), can
interrupt either Table 1 or 2 or can occur when
neither is being executed. These subroutines
can interrupt a table while the Output Flag is
set. When the port goes high during the
execution of a table, the instruction being
executed is completed before the subroutine is
run (i.e., as if the subroutine was called by the
next instruction). For more information, refer to
Section 12 (P85 Label Subroutine).
1.1.4
4
PARAMETER ENTRY TABLE
The CR23X
4
mode is a table with up to
one hundred values. Each value corresponds
to an instruction parameter in the datalogger
program. When the datalogger compiles the
program, values in the
4
table are
transferred to the corresponding instruction
parameter. The datalogger program must be
created using EDLOG which allows instruction
parameters to be assigned to the
4
table.
In a network of datalogger stations, the
4
table can be used to simplify site customization
and the procedure of information entry. Once a
generalized program is developed, application
specific details, e.g., sensor calibration, can be
entered without accessing the
1
and
2
program tables or the
3
subroutine table.
ASSIGNING PARAMETERS TO
4
-
EDLOG
The only way to implement the
4
mode is
through EDLOG. The datalogger program is
generated in EDLOG in the normal way.
To assign a parameter to a
4
location,
position the cursor on the desired parameter
and press the "@" key. EDLOG then prompts
for the location number in the
4
table to
be assigned to the associated parameter. After
a valid number is entered, EDLOG marks the
parameter with "@@nn" to the right of the
parameter description, where "nn" is the
4
location number.
Any program parameter or execution interval
can be marked for inclusion in the table, as
illustrated below.
PROGRAM
*
Table 1 Program
01:
0.0
Execution Interval
(seconds) @@0
01:
Volts (SE) (P1)
1:
1
Reps
2:
1
±
2.5 mV Slow Range
3:
1
SE Channel
4:
1
Loc [ _________ ]
5:
1
Mult @@1
6:
0
Offset @@2
In the above example,
4
location 0 is
assigned to the program table execution
interval, and locations 1 and 2 to the multiplier
and offset of the measurement instruction.
Note that a default execution interval of zero
means the program will not execute until an
alternative interval is entered in location 00 of
the
4
mode. A default multiplier and
offset of 1 and 0 means that the measurement
value is in units of millivolts. A different