Section 7. Installation
137
7.6.3.3.1 Declaring Data Types
Variables and data values stored in final memory can be configured with various
data types to optimize program execution and memory usage.
The declaration of variables with the Dim or Public instructions allows an
optional type descriptor As that specifies the data type. The default data type
(declaration without a descriptor) is IEEE4 floating point, which is equivalent to
the As Float declaration. Variable data types are listed in the table Data Types in
Variable Memory
(p. 137).
Final-data memory data types are listed in the table
Data Types in Final-Storage Memory
(p. 138).
CRBasic example Data Type
Declarations
(p. 140)
shows various data types in use in the declarations and output
sections of a program.
CRBasic allows mixing data types within a single array of variables; however,
this practice can result in at least one problem. The datalogger support software
is incapable of efficiently handling different data types for the same field name.
Consequently, the software mangles the field names in data file headers.
Data Types in Variable Memory
Name
Comman
d
Description
Word
Size
(Bytes)
Notes
Resolution / Range
Float
As Float
or
As IEEE4
IEEE floating
point
4
Data type of all variables
unless declared otherwise.
IEEE Standard 754
•
24 bits (about 7 digits)
•
±
1.4E–45 to
±
3.4E38
Long
As Long
Signed integer
4
Use to store count data in the
range of
±
2,147,483,648
Speed: integer math is faster
than floating point math.
Resolution: 32 bits. Compare
to 24 bits in IEEE4.
Suitable for storing whole
numbers, counting number,
and integers in final-storage
memory. If storing non-
integers, the fractional portion
of the value is lost.
32 bits
–2,147,483,648 to +2,147,483,647
Boolean
As
Boolean
Signed integer
4
Use to store true or false
states, such as states of flags
and control ports. 0 is always
false. –1 is always true.
Depending on the application,
any other number may be
interpreted as true or false.
See the section True = -1,
False = 0
(p. 173).
True =
–
1 or any number ≥ 1
False = any number ≥ 0 and < 1
Содержание CR3000 Micrologger
Страница 2: ......
Страница 3: ......
Страница 4: ......
Страница 6: ......
Страница 30: ......
Страница 34: ......
Страница 36: ......
Страница 96: ......
Страница 200: ...Section 7 Installation 200 FIGURE 42 Running Average Frequency Response FIGURE 43 Running Average Signal Attenuation ...
Страница 485: ...Section 8 Operation 485 8 11 2 Data Display FIGURE 110 Keyboard and Display Displaying Data ...
Страница 487: ...Section 8 Operation 487 FIGURE 112 CR1000KD Real Time Custom ...
Страница 488: ...Section 8 Operation 488 8 11 2 3 Final Storage Data FIGURE 113 Keyboard and Display Final Storage Data ...
Страница 489: ...Section 8 Operation 489 8 11 3 Run Stop Program FIGURE 114 Keyboard and Display Run Stop Program ...
Страница 491: ...Section 8 Operation 491 FIGURE 116 Keyboard and Display File Edit ...
Страница 495: ...Section 8 Operation 495 Low power standby whenever possible Low power bus sets bus and modules to low power ...
Страница 496: ......
Страница 502: ......
Страница 564: ...Section 11 Glossary 564 FIGURE 126 Relationships of Accuracy Precision and Resolution ...
Страница 566: ......
Страница 594: ......
Страница 598: ......
Страница 600: ......
Страница 602: ......
Страница 624: ......
Страница 642: ......
Страница 643: ......