beautypg.com

2 slowsequence / endsequence, Table 16. pipeline mode task priorities – Campbell Scientific CR800 and CR850 Measurement and Control Systems User Manual

Page 136

background image

Section 7. Installation

136 

 

 

CR800 clock. Scan() parameters allow modification of the period in 10- ms
increments. As shown in CRBasic example BeginProg / Scan() / NextScan /
EndProg Syntax
(p. 136), aside from declarations, the CRBasic program may be
relatively short.

CRBasic Example 15. BeginProg / Scan() / NextScan / EndProg Syntax 

BeginProg

Scan

(1,Sec,3,0)

PanelTemp

(RefTemp, 250)

TCDiff

(TC(),6,mV2_5C,1,...)

CallTable

Temp

NextScan

EndProg

 

Scan() determines how frequently instructions in the program are executed, as
shown in CRBasic example Scan Syntax

(p. 136):

CRBasic Example 16. Scan Syntax 

'Scan(Interval, Units, BufferSize, Count)

Scan

(1,Sec,3,0)

·
·
·

ExitScan

 

Scan() has four parameters:

Interval

— the interval between scans.

Units

— the time unit for the interval. Interval is 10 ms <= Interval <= 1 day.

BufferSize

the size (number of scans) of a buffer in RAM that holds the

raw results of measurements. When running in Pipeline mode, using a buffer
allows the processing in the scan to lag behind measurements at times
without affecting measurement timing. Use of the CRBasic Editor default
size is normal. Refer to section SkippedScan

(p. 405)

for troubleshooting tips.

Count

number of scans to make before proceeding to the instruction

following NextScan. A count of 0 means to continue looping forever (or until
ExitScan). In the example in CRBasic example Scan Syntax

(p. 136),

the scan is

1 second, three scans are buffered, and measurements and data storage
continue indefinitely.

7.7.3.7.2 SlowSequence / EndSequence

Slow sequences include automatic and user entered sequences. Background
calibration is an automatic slow sequence.

User-entered slow sequences are declared with the SlowSequence instruction and
run outside the main-program scan. They typically run at a slower rate than the
main scan. Up to four slow-sequences scans can be defined in a program.

Instructions in a slow-sequence scan are executed when the main scan is not
active. When running in pipeline mode, slow-sequence measurements are spliced
in after measurements in the main program, as time allows. Because of this