2 internal data format – Campbell Scientific CR5000 Measurement and Control Module User Manual

Page 42

Advertising
background image

Section 2. Data Storage and Retrieval

2-2

When a new program is compiled that sends data to the PC card, the CR5000
checks if a card is present and if the card has adequate space for the data
tables. If the card has adequate space, the tables will be allocated and the
CR5000 will start storing data to them. If there is no card or if there is not
enough space, the CR5000 will warn that the card is not being used and will
run the program, storing the data in SRAM only. When a card with enough
available memory is inserted the CR5000 will create the data tables on the card
and store the data that is accumulated in SRAM (Section 2.3.4).

Data stored on cards can be retrieved through the communication link to the
CR5000 or by removing the card and inserting it in a PC card slot in a
computer. The PCMCIA interface is much faster than the communication link.
With large files transferring the PC card is faster than collecting the data over
the link.

The CR5000 uses an MS DOS format for the PC cards. Cards can be
formatted in a PC or in the CR5000.

2.2 Internal Data Format

TABLE 2.2-1 CR5000 DATA TYPES

Data Type

Size

Range

Resolution

LONG

4 bytes

-2,147,483,648 to +2,147,483,647

1 bit (1)

IEEE4

4 bytes

1.8 E -38 to 1.7 E 38

24 bits (about 7 digits)

FP2

2 bytes

-7999 to +7999

13 bits (about 4 digits)

Data are stored internally in a binary format. Variables and calculations are
performed internally in IEEE 4 byte floating point with some operations
calculated in double precision. There are two data types used to store data:
IEEE4 four byte floating point and Campbell Scientific two byte floating point
(FP2). The data format is selected in the instruction that outputs the data.
Within the CR5000, time is stored as integer seconds and nanoseconds into the
second since midnight, the start of 1990. While IEEE 4 byte floating point is
used for variables and internal calculations, FP2 is adequate for most stored
data. Campbell Scientific 2 byte floating point provides 3 or 4 significant
digits of resolution, and requires half the memory space as IEEE 4 byte
floating point (2 bytes per value vs 4).

TABLE 2.2-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 2.2-2). Thus, it may be necessary to use
IEEE4 output or an offset to maintain the desired resolution of a measurement.
For example, if water level is to be measured and output to the nearest 0.01
foot, the level must be less than 80 feet for low resolution output to display the
0.01 foot increment. If the water level is expected to range from 50 to 90 feet
the data could either be output in high resolution or could be offset by 20 feet
(transforming the range to 30 to 70 feet).

Advertising