04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Section 7. Installation<br />

measurement hardware until the main scan, including measurements and<br />

processing, is complete.<br />

Main Scans<br />

Execution of the main scan usually occurs quickly, so the processor may be idle<br />

much of the time. For example, a weather-measurement program may scan once<br />

per second, but program execution may only occupy 250 ms, leaving 75% of<br />

available scan time unused. The <strong>CR1000</strong> can make efficient use of this interstitial<br />

scan time to optimize program execution and communications control. Unless<br />

disabled, or crowded out by a too-demanding schedule, self-calibration (see Self-<br />

Calibration (p. 289) ) has priority and uses some interstitial scan time. If selfcalibration<br />

is crowded out, a warning message is issued by the CRBasic<br />

precompiler. Remaining priorities include slow-sequence scans in the order they<br />

are programmed and digital triggers. Following is a brief introduction to the rules<br />

and priorities that govern use of interstitial scan time in sequential mode. Rules<br />

and priorities governing pipeline mode are somewhat more complex and are not<br />

expanded upon.<br />

Permission to proceed with a measurement is granted by the measurement<br />

semaphore (p. 465). Main scans with measurements have priority to acquire the<br />

semaphore before measurements in a calibration or slow-sequence scan. The<br />

semaphore is taken by the main scan at its beginning if there are measurements<br />

included in the scan. The semaphore is released only after the last instruction in<br />

the main scan is executed.<br />

Slow-Sequence Scans<br />

Slow-sequence scans begin after a SlowSequence instruction. They start<br />

processing tasks prior to a measurement but stop to wait when a measurement<br />

semaphore is needed. Slow sequences release the semaphore (p. 465) after complete<br />

execution of each measurement instruction to allow the main scan to acquire the<br />

semaphore when it needs to start. If the measurement semaphore is set by a slowsequence<br />

scan and the beginning of a main scan gets to the top of the queue, the<br />

main scan will not start until it can get the semaphore; it waits for the slow<br />

sequence to release the semaphore. A slow-sequence scan does not hold the<br />

semaphore for the whole of its scan. It releases the semaphore after each use of<br />

the hardware.<br />

WaitDigTrig Scans<br />

Read More! See Synchronizing Measurements (p. 325).<br />

Main scans and slow sequences usually trigger at intervals defined by the Scan()<br />

instruction. Some applications, however, require the main- or slow-sequence scan<br />

to be started by an external digital trigger such as a 5-Vdc pulse on a control port.<br />

The WaitDigTrig() instruction activates a program when an external trigger is<br />

detected. WaitDigTrig() gives priority to begin a scan, but the scan will execute<br />

and acquire the semaphore (p. 465) according to the rules stated in Main Scans (p. 138)<br />

and Slow-Sequence Scans (p. 138). Any processing will be time sliced with<br />

processing from other sequences. Every time the program encounters<br />

WaitDigTrig(), it will stop and wait to be triggered.<br />

Note WaitDigTrig() allows one <strong>CR1000</strong> to exert control over another <strong>CR1000</strong>.<br />

138

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!