Specifications
Section 9. CR1000 Programming
9-18
9.11 Program Execution and Task Priority
Execution of program instructions is prioritized among three tasks:
measurement / control, SDM, and processing. Processes of each task are listed
in TABLE 9.11-1.
The me
asurement / control task is a rigidly timed sequence that measures
sensors and outputs control signals for other devices.
The SDM task manages measurement and control of SDM devices (Campbell
Scientific’s Synchronous Devices for Measurement).
The processing task converts analog and digital measurements to numbers
represented by engineering units, performs calculations, stores data, makes
decisions to actuate controls, and performs serial I/O communication.
TABLE 9.11-1. Task Processes
Measurement Task
• Analog Measurements
• Excitation
• Read Pulse Counters
• Read Control Ports
(GetPort)
• Set Control Ports
(SetPort
• VibratingWire
• PeriodAvg
• CS616
• Calibrate
SDM Task
• All SDM instructions,
except SMDSIO4 and
SDMIO16
Processing Task
• Processing
• Output
• Serial I/O
• SDMSIO4
• SDMIO16
• ReadIO
• WriteIO
• Expression evaluation
and variable setting in
measurement and SDM
instructions
The CR1000 executes these tasks in either pipeline or sequential mode. When
a program is compiled, the CR1000 evaluates the program and determines
which mode to use. Mode information is included in a message returned by the
datalogger, which is displayed by the support software. The CRBASIC Editor
precompiler returns a similar message.
A program can be forced to run in sequential or pipeline modes
by placing the SequentialMode or PipelineMode instruction in
the declarations section of the program.
Some tasks in a program may have higher priorities than other tasks.
Measurement tasks generally take precedence over all others. Priority of tasks
is different for pipeline mode and sequential mode.
9.11.1 Pipeline Mode
Pipeline Mode handles measurement, SDM, and processing tasks separately,
and possibly simultaneously. Measurements are scheduled to execute at exact
times and with the highest priority, resulting in more precise timing of
measurements, and usually more efficient processing and power consumption.
Pipeline scheduling requires that the program be written such that
measurements are executed every scan. Because multiple tasks are taking
place at the same time, the sequence in which the instructions are executed may
not be in the order in which they appear in the program. Therefore, conditional
NOTE