beautypg.com

4 data file formats, 1 data file format – Campbell Scientific ID-2000W Software User Manual

Page 61

background image

SECTION 6. IMPORT/EXPORT

6-7

as an exported parameters by checking the
“Include Time” box. If time is exported it will be
the first parameter and labeled “TIME” with a
units label of “sec”. You may also select what
type of format should be used for the time data.
“As Seconds” produces a floating point number
corresponding to the elapsed time in seconds
since the first data point. “As Time Of Day”
produces a string value formatted as YYYY-
MM-DD HH:MM:SS.SSS. An example of this
format would be:

1995-12-01 18:05:45.289

which represents December 1, 1995 at
6:05:45pm with 0.289 fractional seconds.

6.4 DATA FILE FORMATS

Most data that is recorded by some type of
instrument such as a data logger, analog to
digital converter, etc. is stored in what we will
refer to as a “by scan” format. This means that
the data is stored in the following pattern:

Param0 - Param1 - Param2 - ... - ParamN -
Param0 - Param1 - Param2 - ... - ParamN

where Param0 represents the value of the first
parameter and ParamN is the value of the last
parameter. One reading of each parameter is
called a “scan” of data. Therefore a “by scan”
format consists of the first scan of data followed
by the second scan followed by the third scan
and so on.

This format is very inefficient for plotting large
data files. The reason is simple. Consider as
an example a large data file with 10 parameters
in it and 100,000 scans (readings of each
parameter). If you want to plot the first
parameter you would need to open the data file,
read one number, skip nine numbers, read one
number, skip nine numbers, etc. until all
100,000 values for the first parameter were
read. You could alternately read every number
in the file (all 1,000,000 numbers) and throw
away 90% of them only keeping the first
parameter values (10%). Either way is very
inefficient and slow.

ID-2000 uses what we will refer to as a “by
parameter” file format. This simply means that
all the data for the first parameter is sequential
in the file and can be read as one continuous
data block. In our example the first 100,000
numbers would all be Param0 data. The next
100,000 numbers would be all Param1 data.
And so on. This is much more efficient for
plotting since a parameter can be plotted by
reading just that parameter’s data without
having to skip numbers or throw away
unneeded numbers.

Unfortunately, the “by parameter” format is not
efficient for real-time recording so most data
loggers and data acquisition equipment use the
“by scan” format instead. Therefore most data
files must be imported or converted to the ID-
2000 format in order to plot them.

6.4.1 DATA FILE FORMAT

The ID-2000 data file format is listed here for
informational purposes only in order to assist
you should you decide to write your own file
conversion. Many of the terms used to describe
the file format is technical and associated with
the C programming language constructs.

NOTE: Unless you are experienced in C
programming it is not advisable to attempt
to create a file conversion utility yourself.
Interface Design personnel will only explain
the format and will make no attempt to help
you actually write a conversion program
unless you wish to do so on a contractual
basis. For more information on C language
data types refer to your C compiler manual.

The ID-2000 Windows file format consists of a
file header followed by all the data for the first
parameter, then the second parameter, etc.
This header is placed at the beginning of the
data file and contains necessary information
such as the number of channels, number of
scans, parameter names, recording rate, etc.