Page 1229 - The Mechatronics Handbook
P. 1229

The data storage format has a strong link to the performance and ease-of-use of your data-logging
                                 system. There are three general formats that are commonly used for storage in data-logging systems:
                                 ASCII text files, binary files, and databases.
                                   ASCII text files are the most common and flexible form of data storage. Text files for data-logging
                                 applications are typically made up of a header section and columns of data. The header section gives
                                 information like channel names, units, test equipment, and user comments. The first data column is
                                 usually the time stamp of each sample, and it is followed by another column for each channel being
                                 logged. Text files are useful because they can be opened or imported into almost any software packages,
                                 and they are easily transferred between operating systems. Some disadvantages of text files are that they
                                 use disk space inefficiently, and they require additional processing overhead to write and read from files.
                                 ASCII text files are commonly used when the speed of the acquisition is slow (<1000 samples per second),
                                 the total amount of data to log is not large, and the user needs to easily share data between different
                                 software applications.
                                   Binary files are the most efficient method of data storage. With binary files, the raw bytes that the
                                 computer is using to store data in memory are written directly to the file. This data takes up considerably
                                 less space than the same information written in ASCII text format, and it requires much less processor
                                 overhead than formatting into text. Binary files cannot be viewed in common software applications like
                                 MS Excel. Instead, they must be translated by a software routine into meaningful data. With PC-based
                                 data-logging systems you can log scaled data that is already processed into correct engineering units, or
                                 you can log the raw binary values returned by the digitizer. The raw binary values representing the A/D
                                 conversions of each sample returned from a 16-bit DAQ device take up 16-bits, or 2 bytes, of memory.
                                 The channel scaling routines in your logging software automatically convert this raw data into a real
                                 number that represents the physical value you measured. Scaled data is typically handled inside your
                                 data-logging software as a double precision floating-point value, which refers to a data type taking up 8
                                 bytes of memory on most computer systems.
                                   For performance reasons, some high-speed data-logging systems might log the raw binary values to disk,
                                 along with the necessary scaling constants to convert them to scaled data at a later time. Figure 50.5 shows
                                 the relationship between logging raw binary, scaled binary, and ASCII text. Binary files take up less space
                                 and allow greatly improved stream-to-disk speed. Raw binary files can be less than one-tenth the size of a
                                 text file containing the same information. The disadvantage of binary files is that they typically must be
                                 translated to another format before they can be shared between different application types.



























                                 FIGURE 50.5 Data storage file size example.

                                 ©2002 CRC Press LLC
   1224   1225   1226   1227   1228   1229   1230   1231   1232   1233   1234