Variables - Campbell CR300 Series Operator's Manual

Hide thumbs Also See for CR300 Series:
Table of Contents

Advertisement

CRBasic Example B-2. Inserting Comments
'This program example demonstrates the insertion of comments into a program. Comments are
'placed in two places: to occupy single lines, such as this explanation does, or to be
'placed after a statement.
'Declaration of variables starts here.
Public
Start(6)
BeginProg
EndProg
B.2 Variables
NOTE
Appendix B. Introduction to CRBasic Programming
code. When the CR300 compiler sees a single quote ('), it ignores the rest of
the line.
'Declare the start time array
A variable is a packet of memory that is given an alphanumeric name.
Measurements and processing results pass through variables during program
execution. Variables are declared as Public or Dim. Public variables are
viewable through datalogger support software. Dim variables cannot be
viewed. Declared variables are initialized once when the program starts.
Variable names can be up to 39 characters in length, but most variables should
be no more than 35 characters long. This allows for four additional characters
that are added as a suffix to the variable name when it is output to a data table.
Variable names can contain the following characters:
A to Z
a to z
0 to 9
_ (underscore)
$
Names must start with a letter, underscore, or dollar sign. Spaces and quotation
marks are not allowed. Variable names are not case sensitive.
Keywords and predefined constants are reserved for CR300 use
and will cause a runtime or compile error if used otherwise.
CRBasic Editor Help provides a list of keywords and predefined
constants.
Several variables can be declared on a single line, separated by commas:
Public
RefTemp, AirTemp2, Batt_Volt
By default, variables are set equal to zero at the time the datalogger program
compiles. Variables can also be assigned initial values in the declaration.
Following is an example of declaring a variable and assigning it an initial
value:
Public
SetTemp = {35}
B-3

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr300-rf407Cr300-rf412Cr300-rf422

Table of Contents