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 />

7.8.12.2.1 SubScan() / NextSubScan Details<br />

Many variations of this 200-Hz measurement program are possible to achieve<br />

other burst rates and duty cycles.<br />

The SubScan() / NextSubScan instruction pair introduce added complexities.<br />

The SubScan() / NextSubScan Details, introduces some of these. Caution dictates<br />

that a specific configuration be thoroughly tested before deployment. Generally,<br />

faster rates require measurement of fewer channels. When testing a program,<br />

monitoring the SkippedScan, BuffDepth, and MaxBuffDepth registers in the<br />

<strong>CR1000</strong> Status table may give insight into the use of buffer resources. Bear in<br />

mind that when the number of Scan() / NextScan buffers is exceeded, a skipped<br />

scan, and so a missed-data event, will occur.<br />

• The number of Counts (loops) of a sub-scan is limited to 65535<br />

• Sub-scans exist only within the Scan() / NextScan structure with the Scan()<br />

interval set large enough to allow a sub-scan to run to completion of its<br />

counts.<br />

• Sub-scan interval (i) multiplied by the number of sub-scans (n) equals a<br />

measure time fraction (MT 1 ), a part of "measure time", which measure time is<br />

represented in the MeasureTime register in table Status Table Fields and<br />

Descriptions (p. 528). The EndScan instruction occupies an additional 100 µs<br />

of measure time, so the interval of the main scan has to be ≥ 100 µs plus<br />

measure time outside the SubScan() / EndSubScan construct, plus the time<br />

sub-scans consume.<br />

• Because the task sequencer controls sub-scans, it is not finished until all subscans<br />

and any following tasks are complete. Therefore, processing does not<br />

start until sub-scans are complete and the task sequencer has set the delay for<br />

the start of the next main scan. So, one Scan() / NextScan buffer holds all<br />

the raw measurements inside (and outside) the sub-scan; that is, all the<br />

measurements made in a single main scan. For example, one execution of the<br />

following code sequence stores 30000 measurements in one buffer:<br />

Scan(40,Sec,3,0) 'Scan(interval, units, buffers, count)<br />

SubScan(2,mSec,10000)<br />

VoltSe(Measurement(),3,mV5000,1,False,150,250,1.0,0)<br />

CallTable All4<br />

NextSubScan<br />

NextScan<br />

Note measure time in the previous code is 300 µs + 19 ms, so a Scan() interval<br />

less than 20 ms will flag a compile error.<br />

• Sub scans have the advantage of going at a rate faster than 100 Hz. But<br />

measurements that can run at an integral 100 Hz have an advantage as<br />

follows: since all sub-scans have to complete before the task sequencer can<br />

set the delay for the main scan, processing is delayed until this point (20 ms<br />

in the above example). So more memory is required for the raw buffer space<br />

for the sub-scan mode to run at the same speed as the non-sub-scan mode,<br />

and there will be more delay before all the processing is complete for the<br />

burst. The pipeline (the raw buffer) has to fill further before processing can<br />

start.<br />

234

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

Saved successfully!

Ooh no, something went wrong!