Please enable JavaScript to view this site.

DAQFactory User's Guide

Navigation: 9 Data Logging and Exporting

9.6 Binary logging

Scroll Prev Top Next More

The binary logging methods are the most efficient logging methods in both time and space.  Unfortunately, not all analysis tools will import this format so you may be forced to use ASCII instead.  Also, the binary logging methods only log numeric data and therefore cannot be used to log strings.  Because of these reasons, this mode is rarely used.

There are three binary modes.  Select the desired mode based on the amount of precision required in your data.

Binary 64 bit floating point: This method maintains the complete precision used internally by DAQFactory: 15 to 16 significant figures.  Even time can be recorded to the microsecond in a single column under this format.  However, most data does not require 15 significant figures, so you may want to consider the other options.  The format is simply an array of 64 bit floating point values, one for each column.

Binary 32 bit floating point: This method uses 32 bit floating point values, which take half the space of their 64 bit cousins.  However, they only achieve 6 to 7 significant figures.  Because of this the time columns require two to three values depending on the requested time significant figures.  If the desired time significant figures is greater then 13 (precision better than 1 millisecond), then three columns are required for each time column.  The three columns are the high, middle and low sections of the time value.  To get the actual time value you have to add the three values together after rounding off the least significant figure.  Here's some sample code (in C):

 

    double hi,med,lo;

   // the next three lines convert the floating point values into double floating point::

   hi = (double)Point0;

   med = (double)Point1;

   lo = (double)Point2;

   // round the highest part of time to the nearest 100,000

   hi = floor(hi / 100000 + 0.5) * 100000;

   // round the middle part to the nearest integer

   med = floor(med + 0.5);

   // the lo part does not need to be rounded...

   // add the results to get the actual time value

   ActualTime =  hi+med+lo;

If the desired time significant figures is less than 14, then only two columns are required for each time column.  Again, simply add the two values after rounding:

  double hi,lo;

   // the next two lines convert the floating point values into double floating point::

   hi = (double)Point0;

   lo = (double)Point1;

   // round the highest part of time to the nearest 1,000

   hi = floor(hi / 1000 + 0.5) * 1000;

   // the lo part does not need to be rounded...

   // add the results to get the actual time value

   ActualTime =  hi+lo;

 

Unless you need more than 6 significant figures in your data, or you are only logging a couple of channels, you probably should use the 32 bit version over the 64 bit version.

Binary 32 bit unsigned integers:  This method uses simple 32 bit unsigned integers for each column.  32 bit integers range from 0 to about 4 billion.  This mode is designed to efficiently store counter data or any other integer type data.  If time significant figures is greater than 10 (i.e. need precision better than 1 seconds), then two integer columns are required to store time.  To recreate the actual time value from these two columns add the second column divided by 1 billion (1e9) to the first column.