Page 235 - Mechanical Engineers' Handbook (Volume 2)
P. 235

224   Data Acquisition and Display Systems

                          creating a new variable that reflects some attribute of that relationship. The data collection
                          system can store the results of that variable, such as the sum of the number of times it
                          occurred in some larger time interval, allowing it to be low enough in volume to be mass
                          stored for later analysis.


           5.2 File Storage
                          An easy way to store data is in a file, often a comma-delimited file. This is easy to program
                          and can easily be imported into analysis tools such as spreadsheets. It is not well suited to
                          the compression techniques mentioned above because of the complexity of storing and in-
                          terpreting data. However, for storing records of multiple variables collected at a time interval
                          this can be a very useful technique. An example is shown in Table 4.
                             In the above example, the filename was chosen so that it would be unique. The date
                          and time were concatenated together, eliminating every invalid character with an underscore.
                          This helps to prevent files from being overwritten accidentally and facilitates store-and-
                          forward techniques described below. Files can be sorted by date or name. Often, they are
                          stored in a directory structure so the number of files in any one directory does not get too
                          great. This speeds up file search in a given directory but can make programs more complex
                          that search for files across directories. An example directory structure is the following:

                          C:
                           DataDirectory
                            2003
                             11—files created during November 2003 are stored here
                             12
                            2004
                             01
                             02
                             03
                             Archiving files to backup media is easy in this file organization because one only needs
                          to reference the particular directory for the time frame desired. Files can fill up mass media
                          and so either a manual process to check for file limits, back up old files, and delete them
                          must be instituted or a program to provide the same functions would need to be created.
                             A major deficiency with a file-based system is that when the time range of a search is
                          larger than one file, the analysis can become very difficult. One may be searching for events,


                          Table 4 Example of Storing Multiple Variables in Files
                          Filename             ProcessData20040312142305
                          Data in file:         Timestamp,TemperatureA,TemperatureB,TemperatureC,Rate1,Rate2,Rate3
                                               2004-03-20 12:34,15,14,15,12,13,13
                                               2004-03-20 12:35,15,14,14,12,13,13
                                               2004-03-20 12:36,16,14,13,12,13,13
                                               2004-03-20 12:37,15,14,12,12,13,13
                                               2004-03-20 12:38,15,14,11,12,13,13
                                               2004-03-20 12:39,14,14,11,12,13,13
                                               2004-03-20 12:40,15,14,10,12,13,13
                                               2004-03-20 12:41,15,14,10,12,13,13
                                               2004-03-20 12:42,16,14,10,12,13,13
                                               2004-03-20 12:43,15,14,09,12,13,13
   230   231   232   233   234   235   236   237   238   239   240