Campbell CR800 Specifications Page 103

  • Download
  • Add to my manuals
  • Print
  • Page
    / 324
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 102
Section 4. CRBasic - Native Language Programming
is 1 second, three scans are buffered, and the measurements and output
continue indefinitely.
4.4 Variable Data Types
The declaration of variables (via the DIM or the PUBLIC statement) allow an
optional type descriptor AS that specifies the data type. The default data type,
without a descriptor, is IEEE4 floating point (FLOAT). The data types are
FLOAT, LONG, BOOLEAN, and STRING.
4.4.1 FLOAT
“AS FLOAT” specifies the default IEEE4 data type. If no data type is
explicitly specified with the AS statement, then FLOAT is assumed.
Public Z, RefTemp, TCTemp(3)
Public X AS FLOAT
4.4.2 LONG
“AS LONG” specifies the variable as a 32 bit long integer, ranging from
2,147,483,648 to +2,147,483,647 (31 bits plus the sign bit). There are two
possible reasons a user would do this: (1) speed, since the OS can do math on
integers faster that with floats, and (2) resolution, since the LONG has 31 bits
compared to the 24 bits in the IEEE4.
Examples:
Dim I AS LONG
Public LongCounter AS LONG
4.4.3 BOOLEAN
“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, Ports). A Boolean variable uses the same
32 bit long integer format as a LONG but can set to only one of two values:
True, which is represented as –1, and false, which is represented with 0. The
Boolean data type allows application software to display it as an ON/OFF,
TRUE/FALSE , RED/BLUE, etc.
Public Switches(8) AS Boolean, FLAGS(16) AS Boolean
4.4.4 STRING
“AS STRING * size” specifies the variable as a string of ASCII characters,
NULL terminated, with size specifying the maximum number of characters in
the string. A string is convenient in handling serial sensors, dial strings, text
messages, etc.
4-7
Page view 102
1 2 ... 98 99 100 101 102 103 104 105 106 107 108 ... 323 324

Comments to this Manuals

No comments