Variables - Campbell CR300 Series Product Manual

Compact datalogger
Hide thumbs Also See for CR300 Series:
Table of Contents

Advertisement

Table 12-1: Data types, ranges and resolutions
Data type
Description
IEEE four-byte
Float
floating point
Long
signed integer
Boolean
signed integer
String
ASCII String
Campbell Scientific
FP2
two-byte floating point
NSEC
eight-byte time stamp

12.4.1 Variables

In CRBasic, the declaration of variables (via the
optional type descriptor
Boolean, and String. The default type is Float.
Example variables declared with optional data types
Public
As Float
PTemp
Public
As Long
Counter
Public
As String
SiteName
As Float
specifies the default data type. If no data type is explicitly specified with the
Float
statement, then
performed internally in IEEE 4 byte floating point with some operations calculated in double
precision. A good rule of thumb is that resolution will be better than 1 in the seventh digit.
As Long
specifies the variable as a 32 bit integer. There are two possible reasons a user would
do this: (1) speed, since the CR300 series Operating System can do math on integers faster than
with Floats, and (2) resolution, since the
Float. A good application of the
large.
As Boolean
specifies the variable as a 4 byte Boolean. Boolean variables are typically used for
flags and to represent conditions or hardware that have only 2 states (e.g., On/Off, High/Low). A
Boolean variable uses the same 32 bit long integer format as a
two values: True, which is represented as –1, and false, which is represented with 0. When a
+/–1.8 *10^–38 to
four-byte
–2,147,483,648 to
four-byte
As
that specifies the data type. The data types are Float, Long,
, Batt_volt
* 24
is assumed. Measurement variables are stored and calculations are
As Long
Range
+/–3.4 *10^38
(about 7 digits)
+2,147,483,647
–1, 0
–7999 to +7999
(about 4 digits)
DIM
PUBLIC
or the
Long
has 31 bits compared to the 24 bits in the
declaration is a counter that is expected to get very
Resolution
Where used
24 bits
1 bit
variables, output
True (–1) or
variables,
False ( 0)
sample output
variables,
sample output
13 bits
nanoseconds
variables, output
statement) allows an
Long
but can set to only one of
12. Working with data
variables
output
As
59

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr300Cr310

Table of Contents