Table 12. Data Types in Final-Data Memory
Name Argument Description
Word Size
(Bytes)
Notes Resolution / Range
UINT2
UINT2
Unsigned integer 2
Use to store positive count data ≤
+65535.
Use to store port or flag status. See
CRBasic example Load binary
information into a variable
(p. 139).
When Public FLOATs convert to
UINT2 at final data storage, values
outside the range 0 – 65535 yield
unusable data. INF converts to
65535. NAN converts to 0.
0 to 65535
UINT4
UINT4
Unsigned integer 4
Use to store positive count data ≤
2147483647.
Other uses include storage of long ID
numbers (such as are read from a bar
reader), serial numbers, or address.
May also be required for use in some
Modbus devices.
0 to 2147483647
Boolean
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. 164). To save
memory, consider using UINT2 or
BOOL8.
True = –1 or any number ≥ 1
False = any number ≥ 0 and < 1
Bool8
Bool8
Integer 1
8 bits (0 or 1) of information. Uses
less space than 32-bit BOOLEAN.
Holding the same information in
BOOLEAN will require 256 bits.
See Bool8 Data Type
(p. 198).
True = 1, False = 0
NSEC
NSEC
Time stamp 8
Divided up as four bytes of seconds
since 1990 and four bytes of
nanoseconds into the second. Used to
record and process time data. See
NSEC Data Type
(p. 202).
1 nanosecond
String
String
ASCII string
Minimum: 3
(4 with null
terminator)
Default: 24
Maximum:
limited only
to the size of
available
CR1000
memory.
See caution.
1
String size is defined by the CR1000
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. 282) and Serial
I/O
(p. 245)..
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 CR1000 memory.
132