Please enable JavaScript to view this site.

DAQFactory User's Guide

Navigation: 2 Guided Tour

2.9 Logging Data

Scroll Prev Top Next More

So far we have seen how to take data and display it on the screen.  Next we will learn how to store this data to disk so that it can be opened with another program for analysis.  In this example we will create a simple comma delimited file with our pressure data.

1.  Click on LOGGING: in the workspace.

This will display the logging set summary view.  Here you can see all your logging sets displayed and their running status.  A logging set is a group of data values being logged in a particular way to a particular file.  You can have as many logging sets as you need, and they can run concurrently.

2_9_LoggingData_1

2.  Click on the Add button in the logging set and when prompted for the new name, type in Log and click OK.

Like channels and all other DAQFactory names, the logging set name must start with a letter and only contain letters, numbers or the underscore.  Once you click OK, the logging set view will be displayed for the new logging set.  You can also get to this view by clicking on the logging set name listed under LOGGING: in the workspace.  You may have to click on the + sign next to LOGGING to see your logging sets listed in the workspace.

2_9_LoggingData_2

2_9_LoggingData_4

3.  Next to Logging Method, select ASCII Delimited (it is probably already selected).

ASCII Delimited is probably the most common method for data logging as it can be read by most other programs such as Excel.  Unfortunately, it is not as space efficient or fast as the binary methods.  But unless you have strict space constraints or you are logging extremely fast data, we suggest ASCII since it can easily be read by other programs like Excel.

2_9_LoggingData_6

4.  Next to File Name enter c:\DAQFactory\User\Data\mylogfile.csv  

It is usually best to fully specify the path to your file, otherwise the DAQFactory will try and store your data in your DAQFactory directory, which is read-only.  The .csv is a windows standard designation for comma delimited values.  Note the c:\DAQFactory\User\Data directory will need to exist (and will if you installed DAQFactory in its normal place).  Use a different folder if you would like.

Note: The DAQFactory installation folder (usually C:\DAQFactory) and many of its subdirectories are installed as read-only folders for security to protect the DAQFactory application.  The User and Persist subfolders are marked as read-write and can be used as you need.  Persist is typically used for the Channel Persist files.  If you install DAQFactory under Program Files, windows may keep you from writing to any of DAQFactory's folders, including the Persist folder, in which case you would need to create your own folders for Persist and logging files.

2_9_LoggingData_8

5.  In the Channels Available table, click on the row with Pressure, then click on the >> button to move it to the Channels to Log table.

Each logging set can log any combination of channels.  In this case, we will just log the input channel.

2_9_LoggingData_10

6.  Click on Apply to save the changes.

2_9_LoggingData_11

7.  To start logging, click on the + next to LOGGING to display the new logging set, then right click on the logging set Log and select Begin Logging Set.  

Once started, the icon next to Log will change to indicate that this logging set is running.

2_9_LoggingData_13

8.  Wait at least 10 or 15 seconds to log some data and then right click on the logging set again and select End Logging Set to stop logging.

You can also start and stop logging sets using script, for example in the OnLButtonUp event of the variable value component that we used earlier.

2_9_LoggingData_15

9.  Now start Excel or Notepad and open the file c:\DAQFactory\User\Data\mylogfile.csv.  

You will see two columns, time and data.  By default the time is given in a format specific for your locale.  DAQFactory can format this however you like, as well as log in a more computer friendly seconds since 1970 format.

2_9_LoggingData_16

Hint: if you cannot find the mylogfile.csv file, check to make sure that you selected Pressure to log and not Out.  Since Out is an output channel, it only gets new values to log when you actually set it to something.

You have now acquired, displayed and logged your data.  

For simpler applications, it is simply a matter of repeating most of these steps for additional channels.  But even for simpler applications there are many adjustments available for fine tuning your application to work the way you want.  These, along with many more walk-throughs and examples are provided in the appropriate sections of this manual.  At this point we suggest playing with DAQFactory a bit, jumping to the appropriate sections of the manual for more detail on the areas of DAQFactory you may be interested in utilizing.

For more information on logging including the various file formats you can use, please see the chapter entitled Data Logging and Exporting.