Campbell Scientific CR1000KD CR800 and CR850 Measurement and Control Systems - Page 134
Table 16., Pipeline Mode Task Priorities
View all Campbell Scientific CR1000KD manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 134 highlights
Section 7. Installation the back of the queue, and the next task in the queue begins running. In this way, all tasks are given equal processing time by the datalogger. All tasks are given the same general priority. However, when a conflict arises between tasks, program execution adheres to the priority schedule in table Pipeline Mode Task Priorities (p. 134). Table 16. Pipeline Mode Task Priorities 1. Measurements in main program 2. Background calibration 3. Measurements in slow sequences 4. Processing tasks 7.7.3.6.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 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 communications activity, or if other interrupts, such as engaging Campbell Scientific mass-storage media (USB: drive), 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 their 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 background 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. 134