01-06-2010 09:29 AM
Hi amswak,
Depending on the conditions that need to be met for a "key event", you can place the TDMS Write in a case structure and only enter that case when your conditions are met (i.e. every n number of iterations, value greater than x, etc.).
Thank you for choosing National Instruments.
Aaron
National Instruments
Applications Engineer
01-06-2010 11:49 AM - edited 01-06-2010 11:51 AM
That's what I figured.
The reason why I asked is this:
You might find it easier, more maintainable, and with a better user experience to use the DAQmx 9.0 feature for logging to TDMS. Here are the reasons why you might be better off with that solution:
1) It's simple: You just call DAQmxConfigureLogging(...) with a file path before starting the task. Then everything that is read (using DAQmxRead... calls) will be logged to the TDMS file. No queue is necessary.
2) It produces a much smaller file: When you call DAQmxRead (if you're reading scaled double data), you are writing 8 bytes per sample to disk. With this feature, it writes (for most DAQ devices) 2 bytes per sample. This savings of atleast 4x accounts for comparable savings you propose with 50 kHz to 10 kHz downsampling without requiring the user input to switch (while maintaining all of the data).
3) It's fast: Aside from the fact that you're writing 1/4 the data, there are many optimizations that can dramatically improve performance.
It might be too late in your development to switch to this solution, but it might prevent further headaches in the future by simplifying your application. To use it, download DAQmx 9.0.2 (http://joule.ni.com/nidu/cds/view/p/id/1444/lang/en) and simply call DAQmxConfigureLogging.
Let me know if you have any questions about it.