Section 7. Installation
162
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().
Summary of Contents for CR3000 Micrologger
Page 2: ......
Page 3: ......
Page 4: ......
Page 6: ......
Page 30: ......
Page 34: ......
Page 36: ......
Page 96: ......
Page 485: ...Section 8 Operation 485 8 11 2 Data Display FIGURE 110 Keyboard and Display Displaying Data ...
Page 487: ...Section 8 Operation 487 FIGURE 112 CR1000KD Real Time Custom ...
Page 491: ...Section 8 Operation 491 FIGURE 116 Keyboard and Display File Edit ...
Page 496: ......
Page 502: ......
Page 564: ...Section 11 Glossary 564 FIGURE 126 Relationships of Accuracy Precision and Resolution ...
Page 566: ......
Page 594: ......
Page 598: ......
Page 600: ......
Page 602: ......
Page 624: ......
Page 642: ......
Page 643: ......