04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix A. CRBasic Programming Instructions<br />

-or-<br />

If [condition 1] Then<br />

[then statements]<br />

ElseIf [condition 2] Then<br />

[elseif then statements]<br />

Else<br />

[else statements]<br />

EndIf<br />

Scan / ExitScan / ContinueScan / NextScan<br />

Establishes the program scan rate. ExitScan and ContinueScan are optional. See<br />

Faster Measurement Rates (p. 231) for information on use of Scan() / NextScan in<br />

burst measurements.<br />

Syntax<br />

Scan(Interval, Units, Option, Count)<br />

[statement block]<br />

ExitScan<br />

[statement block]<br />

ContinueScan<br />

[statement block]<br />

NextScan<br />

Select Case / Case / Case Is / Case Else / EndSelect<br />

Executes one of several statement blocks depending on the value of an<br />

expression. CaseElse is optional. Note that EndSelect and EndIf call the same<br />

function.<br />

Syntax<br />

Select Case testexpression<br />

Case [expression 1]<br />

[statement block 1]<br />

Case [expression 2]<br />

[statement block 2]<br />

Case Is [expression fragment]<br />

Case Else<br />

[statement block 3]<br />

EndSelect<br />

SlowSequence<br />

Marks the beginning of a section of code that will run concurrently with the main<br />

program.<br />

Syntax<br />

SlowSequence<br />

SubScan / NextSubScan<br />

Controls a multiplexer or measures some analog inputs at a faster rate than the<br />

program scan. See Faster Measurement Rates (p. 231) for information on use of<br />

SubScan / NextSubScan in burst measurements.<br />

Syntax<br />

SubScan(SubInterval, Units, Count)<br />

[measurements and processing]<br />

NextSubScan<br />

481

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

Saved successfully!

Ooh no, something went wrong!