Section 7. Installation
212
3. Measurements in slow sequences
4. Processing tasks
7.6.3.12.2 Sequential Mode
Sequential mode executes instructions in the sequence in which they are written in
the program. Sequential mode may be slower than pipeline mode since it executes
only one line of code at a time. After a measurement is made, the result is
converted to a value determined by processing arguments that are included in the
measurement command, and then program execution proceeds to the next
instruction. This line-by-line execution allows writing conditional measurements
into the program.
Note
The exact time at which measurements are made in sequential
mode may vary if other measurements or processing are made
conditionally, if there is heavy communication activity, or if other interrupts,
such as accessing a Campbell Scientific mass storage device or memory
card, occur.
When running in sequential mode, the datalogger uses a queuing system for
processing tasks similar to the one used in pipeline mode. The main difference
when running a program in sequential mode is that there is no pre-scheduling of
measurements; instead, all instructions are executed in the programmed order.
A priority scheme is used to avoid conflicting use of measurement hardware. The
main scan has the highest priority and prevents other sequences from using
measurement hardware until the main scan, including processing, is complete.
Other tasks, such as processing from other sequences and communications, can
occur while the main sequence is running. Once the main scan has finished, other
sequences have access to measurement hardware with the order of priority being
the auto self calibration sequence followed by the slow sequences in the order
they are declared in the program.
Note
Measurement tasks have priority over other tasks such as
processing and communication to allow accurate timing needed within
most measurement instructions.
Care must be taken when initializing variables when multiple sequences are used
in a program. If any sequence relies on something (variable, port, etc.) that is
initialized in another sequence, there must be a handshaking scheme placed in the
CRBasic program to make sure that the initializing sequence has completed
before the dependent task can proceed. This can be done with a simple variable or
even a delay, but understand that the CR1000 operating system will not do this
handshaking between independent tasks.
A similar concern is the reuse of the same variable in multiple tasks. Without
some sort of messaging between the two tasks placed into the CRBasic program,
unpredictable results are likely to occur. The
SemaphoreGet()
and
SemaphoreRelease()
instruction pair provide a tool to prevent unwanted access
of an object (variable, COM port, etc.) by another task while the object is in use.
Consult
CRBasic Editor Help
for information on using
SemaphoreGet()
and
SemaphoreRelease()
.
Содержание CR6 Series
Страница 2: ......
Страница 4: ......
Страница 6: ......
Страница 32: ......
Страница 36: ......
Страница 38: ......
Страница 76: ...Section 5 Overview 76 FIGURE 20 Half Bridge Wiring Example Wind Vane Potentiometer ...
Страница 80: ...Section 5 Overview 80 FIGURE 23 Pulse Input Wiring Example Anemometer ...
Страница 136: ......
Страница 251: ...Section 7 Installation 251 FIGURE 46 Running Average Frequency Response FIGURE 47 Running Average Signal Attenuation ...
Страница 454: ...Section 8 Operation 454 FIGURE 104 Narrow Sweep High Noise ...
Страница 459: ...Section 8 Operation 459 FIGURE 106 Vibrating Wire Sensor Calibration Report ...
Страница 535: ...Section 8 Operation 535 8 11 2 Data Display FIGURE 121 CR1000KD Displaying Data ...
Страница 537: ...Section 8 Operation 537 FIGURE 123 CR1000KD Real Time Custom ...
Страница 538: ...Section 8 Operation 538 8 11 2 3 Final Storage Data FIGURE 124 CR1000KD Final Storage Data ...
Страница 539: ...Section 8 Operation 539 8 11 3 Run Stop Program FIGURE 125 CR1000KD Run Stop Program ...
Страница 541: ...Section 8 Operation 541 FIGURE 127 CR1000KD File Edit ...
Страница 542: ...Section 8 Operation 542 8 11 5 PCCard Memory Card Management FIGURE 128 CR1000KD PCCard Memory Card Management ...
Страница 546: ......
Страница 549: ...Section 9 Maintenance Details 549 FIGURE 133 Separate Back Shell from Module FIGURE 134 Disconnect Battery Connector ...
Страница 552: ......
Страница 610: ...Section 11 Glossary 610 FIGURE 137 Relationships of Accuracy Precision and Resolution ...
Страница 612: ......
Страница 648: ......
Страница 650: ......
Страница 688: ......
Страница 689: ......