2 slowsequence / endsequence, 3 subscan() / nextsubscan, 4 scan priorities in sequential mode – Campbell Scientific CR1000 Measurement and Control System User Manual
Page 137

Section 7. Installation
137
allows the processing in the scan to lag behind measurements at times
without affecting measurement timing. Use of the CRBasic Editor default
size is normal. Refer to section SkippedScan
for troubleshooting tips.
•
Count
— number of scans to make before proceeding to the instruction
following NextScan. A count of 0 means to continue looping forever (or until
ExitScan). In the example in CRBasic example Scan Syntax
(p. 136),
the scan is
1 second, three scans are buffered, and measurements and data storage
continue indefinitely.
7.7.3.7.2 SlowSequence / EndSequence
Slow sequences include automatic and user entered sequences. Background
calibration is an automatic slow sequence.
User-entered slow sequences are declared with the SlowSequence instruction and
run outside the main-program scan. They typically run at a slower rate than the
main scan. Up to four slow-sequences scans can be defined in a program.
Instructions in a slow-sequence scan are executed when the main scan is not
active. When running in pipeline mode, slow-sequence measurements are spliced
in after measurements in the main program, as time allows. Because of this
splicing, measurements in a slow sequence may span across multiple-scan
intervals in the main program. When no measurements need to be spliced, the
slow-sequence scan will run independent of the main scan, so slow sequences
with no measurements can run at intervals
≤ main-scan interval (still in 10-ms
increments) without skipping scans. When measurements are spliced, checking
for skipped slow scans is done after the first splice is complete rather than
immediately after the interval comes true.
In sequential mode, all instructions in slow sequences are executed as they occur
in the program according to task priority.
Background calibration is an automatic, slow-sequence scan.
Read More! Self-Calibration
(p. 289)
7.7.3.7.3 SubScan() / NextSubScan
SubScan() / NextSubScan are used in the control of analog multiplexers (see the
appendix Analog Multiplexers
(p. 560)
for information on available analog
multiplexers) or to measure analog inputs at a faster rate than the program scan.
SubScan() / NextSubScan can be used in a SlowSequenc / EndSequence with
an interval of 0. SubScan cannot be nested. PulseCount or SDM measurement
cannot be used within a sub scan.
7.7.3.7.4 Scan Priorities in Sequential Mode
Note Measurement tasks have priority over other tasks such as processing and
communication to allow accurate timing needed within most measurement
instructions.
A priority scheme is used in sequential mode to avoid conflicting use of
measurement hardware. As illustrated in figure Sequential-Mode Scan Priority
Flow Diagrams
(p. 139),
the main scan sequence has the highest priority. Other
sequences, such as slow sequences and calibration scans, must wait to access