Please enable JavaScript to view this site.

DAQFactory User's Guide

Navigation: 9 Data Logging and Exporting

9.7 Exporting

Scroll Prev Top Next More

Export sets are similar to logging except that export sets run once with the current history and then stop, while logging sets take acquired data as it is accumulated and logs it.  One big advantage of export sets is that you specify expressions instead of simple channel names.  In this way you can subset data, or export calculated data.  

Creating and configuring an export set is almost the same as a logging set.  There is only one table for specifying what gets exported.  In this table, create a row for each field you would like to export.  In each row, specify a name for the field (also used for the header in the ASCII logging method), an expression to log (i.e. MyChannel, or MyChannel / OtherChannel), and the number of significant figures to use.

The export set details are very similar to logging sets.  The difference is that export sets do not have auto splitting and have an option for whether an existing file should be overwritten or appended to.  Logging sets always append to existing files.

Application: One common way to use exports is to actually specify scalar values for the expressions (i.e. MyChannel[0]) and then use a sequence to repetitively start the export set.  This will allow you to log any type of data, converted, calculated or otherwise.  To do this:

1. Create a new export set.  In this example we'll call it WriteOne.

2. Add columns for each data point you would like to log.  Each expression should result in a scalar value without history.  Go to the details page and make sure its set to Append.

3. Create a new sequence:

 

while(1)

  beginexport(WriteOne)

  delay(1)

endwhile

4. Now when you run this new sequence, it will start your export set once a second, each time writing a single line of data.

Application: You can extend the above application to log lines of data at particular events.  Just call beginexport() whenever you want to write a line of data.

Application: When doing batch runs where you start and stop logging with each new batch, there are two ways to log.  One is to use logging sets of course, and simply start and stop the set at the beginning and end of the batch.  But this does not give you the option to throw away the batch (and not log it).  If you want to be able to run a batch and then optionally save to disk, create an export set for your data instead of a logging set.  You'll want to clear the history of your channels at the beginning of the batch so you are not logging older data.