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

BeginProg<br />

Scan()<br />

aaa = 3<br />

bbb = 2<br />

ccc = 4<br />

VariableName(aaa,bbb,ccc) = 2.718<br />

NextScan<br />

EndProg<br />

Dimensioning Strings<br />

Strings can be declared to a maximum of two dimensions. The third "dimension"<br />

is used for accessing characters within a string. See String Operations (p. 236).<br />

String length can also be declared.<br />

A one-dimension string array called StringVar, with five elements in the array<br />

and each element with a length of 36 characters, is declared as<br />

Public StringVar(5) As String * 36<br />

Five variables are declared, each 36 characters long:<br />

StringVar(1)<br />

StringVar(2)<br />

StringVar(3)<br />

StringVar(4)<br />

StringVar(5)<br />

Data Types<br />

Variables and stored data can be configured with various data types to optimize<br />

program execution and memory usage.<br />

The declaration of variables (via the Dim or Public instructions) allows an<br />

optional type descriptor As that specifies the data type. The default data type,<br />

without a descriptor, is IEEE4 floating point (As FLOAT). Variable data types<br />

are As String and three numeric types: As Float, As Long, and As Boolean.<br />

Stored data has additional data type options FP2, UINT2, BOOL8, and NSEC.<br />

CRBasic example Data Type Declarations (p. 120) shows these in use in the<br />

declarations and output sections of a CRBasic program.<br />

The CRBasic programming language allows mixing data types within a single<br />

array of variables; however, this practice can result in at least one problem. The<br />

datalogger support software is incapable of efficiently handling different data<br />

types for the same field name. Consequently, the software mangles the field<br />

names in data file headers.<br />

Table Data Types (p. 119) lists details of available data types.<br />

118

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

Saved successfully!

Ooh no, something went wrong!