Specifications

Section 9. CR1000 Programming
9-9
9.6.1.4 Data Type Operational Detail
FP2 Default CR1000 data type for stored data. While IEEE 4 byte
floating point is used for variables and internal calculations, FP2 is
adequate for most stored data. FP2 provides 3 or 4 significant digits
of resolution, and requires half the memory as IEEE 4.
TABLE 9.6-2. Resolution and Range Limits of FP2 Data
Zero Minimum Magnitude Maximum Magnitude
0.000
±0.001 ±7999.
The resolution of FP2 is reduced to 3 significant digits when the first
(left most) digit is 8 or greater (TABLE 9.6-2). Thus, it may be
necessa
ry to use IEEE4 format or an offset to maintain the desired
resolution of a measurement. For example, if water level is to be
measured and stored to the nearest 0.01 foot, the level must be less
than 80 feet for low-resolution format to display the 0.01-foot
increment. If the water level is expected to range from 50 to 90 feet
the data can be formatted as IEEE4.
TABLE 9.6-3. FP2 Decimal Location
Absolute Value Decimal Location
0 - 7.999 X.XXX
8 - 79.99 XX.XX
80 - 799.9 XXX.X
800 - 7999. XXXX.
IEEE4 IEEE Standard 754.
Advantages: Industry standard.
Disadvantages: Uses twice the storage space of FP2. See Section
9.13.1 for limitations in using IEEE4 in arithmetic.
LONG Adva
ntages: Speed -- the CR1000 can do math on integers faster than
with floats. Resolution-- LONG has 31 bits compared to 24-bits in
IEEE4.
Disadvantages: In most applications, it is not suitable for stored
output data since any fractional portion of the value is lost.
UINT2 Typical uses are for efficient storage of totalized pulse counts, port
status (e.g. 16 ports on an SDM-IO16 stored in one variable) or
integer values that store binary flags.
Float values are converted to integer UINT2 values as if using the
INT function. Values may need to be range checked since values
outside the range of 0-65535 will yield UINT2 data that is probably
unusable. NAN values are stored as 65535.