beautypg.com

Campbell Scientific CR200/CR200X-series Dataloggers User Manual

Page 109

background image

Section 10. CRBASIC Programming Instructions

If ... Then ... Else … ElseIf ... EndIf

Allows conditional execution, based on the evaluation of an expression. Else is

optional. ElseIf is optional (EndSelect and EndIf call the same function).

Syntax

If [condition] Then [thenstatements] Else [elsestatements]

-or-

If [condition 1] Then

[then statements]

ElseIf [condition 2] Then

[elseif then statements]

Else

[else statements]

EndIf

InterruptSequence

Specifies code to run when an interrupt condition occurs.

Syntax

InterruptSequence

LoggerIdentify

Sets an identification string in the datalogger that will be returned when another

string is sent to the datalogger.

Syntax

LoggernetIdentify (RequestString",ReturnString")

Scan … NextScan

Establishes the program scan rate. ExitScan and ContinueScan are optional.

Syntax

Scan (Interval, Units)

...

Next Scan

...

ContinueScan

...

Next Scan

ScanLEDOff

Turns off the LED on the datalogger's front case that indicates a program scan is

occurring.

Select Case … Case … Case Is … Case Else … EndSelect

Executes one of several statement blocks depending on the value of an

expression. CaseElse is optional. (EndSelect and EndIf call the same CR200(X)

function).

Syntax

Select Case testexpression

Case [expression 1]

[statement block 1]

Case [expression 2]

[statement block 2]

Case Is [expression fragment]

Case Else

[statement block 3]

EndSelect

97