Section 7. Installation
194
of information (eight states with one bit per state). To store the same information
using a 32 bit
BOOLEAN
data type, 256 bits are required (8 states * 32 bits per
state).
When programming with BOOL8 data type, repetitions in the output processing
DataTable()
instruction must be divisible by two, since an odd number of bytes
cannot be stored. Also note that when the CR800 converts a LONG or FLOAT
data type to BOOL8, only the least significant eight bits of the binary equivalent
are used, i.e., only the binary representation of the decimal integer
modulo divide
(p. 505)
256 is used.
Example:
Given: LONG integer 5435
Find: BOOL8 representation of 5435
Solution:
5435 / 256 = 21.2304687
0.2304687 * 256 = 59
Binary representation of 59 = 00111011 (CR800 stores
these bits in reverse order)
When
datalogger support software
(p. 86)
retrieves the BOOL8 value, it splits it
apart into eight fields of
-1
or
0
when storing to an ASCII file. Consequently,
more memory is required for the ASCII file, but CR800 memory is conserved.
The compact
BOOL8
data type also uses less comms band width when
transmitted.
CRBasic example
Bool8 and Bit Shift Operators
(p. 196)
programs the CR800 to
monitor the state of 32 "alarms" as a tutorial exercise. The alarms are toggled by
manually entering zero or non-zero (e.g., 0 or 1) in each public variable
representing an alarm as shown in figure
Alarms Toggled in Bit Shift Example
(p.
Samples of the four public variables
FlagsBool8(1)
,
FlagsBool8(2)
,
FlagsBool8(3)
, and
FlagsBool8(4)
are stored in data table
Bool8Data
as four
one-byte values. However, as shown in figure
Bool8 Data from Bit Shift
Example (Numeric Monitor)
(p. 195),
when viewing the data table in a
numeric
monitor
(p. 506),
data are conveniently translated into 32 values of
True
or
False
.
In addition, as shown in figure
Bool8 Data from Bit Shift Example (PC Data File)
(p. 196),
when
datalogger support software
(p. 86)
stores the data in an ASCII file, it is
stored as 32 columns of either
-1
or
0
, each column representing the state of an
alarm. You can use variable
aliasing
(p. 138)
in the CRBasic program to make the
data more understandable.
Summary of Contents for CR800 Series
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 34: ......
Page 54: ......
Page 92: ......
Page 310: ......
Page 446: ...Section 8 Operation 446 8 11 2 Data Display FIGURE 100 CR1000KD Displaying Data ...
Page 448: ...Section 8 Operation 448 FIGURE 102 CR1000KD Real Time Custom ...
Page 449: ...Section 8 Operation 449 8 11 2 3 Final Storage Data FIGURE 103 CR1000KD Final Storage Data ...
Page 450: ...Section 8 Operation 450 8 11 3 Run Stop Program FIGURE 104 CR1000KD Run Stop Program ...
Page 452: ...Section 8 Operation 452 FIGURE 106 CR1000KD File Edit ...
Page 456: ......
Page 462: ......
Page 523: ...Section 11 Glossary 523 FIGURE 116 Relationships of Accuracy Precision and Resolution ...
Page 524: ......
Page 526: ......
Page 556: ......
Page 558: ......
Page 560: ......
Page 597: ......