Section 7. Installation
188
Data Types in Variable Memory
Name Command
Description
Word
Size
(Bytes)
Notes
Resolution / Range
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. 224).
True =
–
1 or any number ≥ 1
False = any number ≥ 0 and < 1
String
As String
ASCII string
Minimum
: 3 (4
with null
terminato
r)
Default:
24
Maximu
m:
limited
only to
the size of
available
CR6
memory.
See caution.
1
String size is defined by the
CR6 operating system and
CRBasic program.
When converting from
STRING
to
FLOAT
,
numerics at the beginning of a
string convert, but conversion
stops when a non-numeric is
encountered. If the string
begins with a non-numeric,
the
FLOAT
will be
NAN
. If
the string contains multiple
numeric values separated by
non-numeric characters, the
SplitStr()
instruction can be
used to parse out the numeric
values. See the sections
String
Operations
(p. 379)
and
Serial
I/O
(p. 356).
Unless declared otherwise, string size is 24
bytes or characters. String size is allocated
in multiples of four bytes; for example,
String * 25
,
String * 26
,
String * 27
, and
String * 28
allocate 28 bytes (27 usable).
Minimum string size is 4 (3 usable). See
CRBasic Editor Help
for more information.
Maximum length is limited only by
available CR6 memory. As a special case,
a string can be declared as
String * 1
. This
allows the efficient storage of a single
character. The string will take up 4 bytes in
memory and when stored in a data table,
but it will hold only one character.
1
CAUTION When using a very long string in a variable declared
Public
, the operations of
datalogger support software
(p. 663)
will
frequently transmit the entire string over the communication link. If communication bandwidth is limited, or if communications are
paid for by they byte, declaring the variable
Dim
may be preferred.
Summary of Contents for CR6 Series
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 36: ......
Page 38: ......
Page 76: ...Section 5 Overview 76 FIGURE 20 Half Bridge Wiring Example Wind Vane Potentiometer ...
Page 80: ...Section 5 Overview 80 FIGURE 23 Pulse Input Wiring Example Anemometer ...
Page 136: ......
Page 454: ...Section 8 Operation 454 FIGURE 104 Narrow Sweep High Noise ...
Page 459: ...Section 8 Operation 459 FIGURE 106 Vibrating Wire Sensor Calibration Report ...
Page 535: ...Section 8 Operation 535 8 11 2 Data Display FIGURE 121 CR1000KD Displaying Data ...
Page 537: ...Section 8 Operation 537 FIGURE 123 CR1000KD Real Time Custom ...
Page 538: ...Section 8 Operation 538 8 11 2 3 Final Storage Data FIGURE 124 CR1000KD Final Storage Data ...
Page 539: ...Section 8 Operation 539 8 11 3 Run Stop Program FIGURE 125 CR1000KD Run Stop Program ...
Page 541: ...Section 8 Operation 541 FIGURE 127 CR1000KD File Edit ...
Page 546: ......
Page 552: ......
Page 610: ...Section 11 Glossary 610 FIGURE 137 Relationships of Accuracy Precision and Resolution ...
Page 612: ......
Page 648: ......
Page 650: ......
Page 688: ......
Page 689: ......