07-27-2012 11:34 AM
Hi all
Let me start by saying sorry if this has been posted, but I cannot find it.
Here is the situation.
I would like to run and display continuously the information coming from the DAQ on the screen on a strip chart, and while this is going on I want to be able to record data by command at different times without stopping the DAQ.
Are there commands for setting up files for recording, starting and stopping TDMS while the DAQ just runs continuously.
If so where can I find this information, Links, commands etc...
Many Thanks
07-30-2012 09:23 AM
lriddick,
I would recommend modifying one of the examples that comes with CVI to suit your needs. There is an example that does a continuous DAQmx acquisition and logs to a .TDMS file located in the Example Finder for CVI at:
07-30-2012 12:17 PM
that is the example i am using
the problem is when i want to stop the recording i want it to stop and save only the recording of the file and not stop the daq say for example...i stop the recording save the file as file0.tdms.
while the daq is still running, (i do not want to stop the daq at all). i start another recording with a different file name file1.tdms
DAQmxErrChk (DAQmxConfigureLogging(gTaskHandle,TDMSfilePath,DAQmx_Val_LogAndRead,"GroupName",DAQmx_Val_OpenOrCreate));
The example lays out a gTaskHandle that is used to link theDAQ to the TDMS logging, i would have to stop the daq and restart this an infinanite number of times to give it a different file name (not really pratical for the application)
how can i stop the recording, save and then start another recording without touching the gTaskTHandle?
the other Example benchmarking.cws looks as if you have to allocate a set size of memory for the file and then read the data into the buffer and then write the data to disk. (this will not work because the size of the recording is never the same).
Or am i completly lost?????
07-31-2012 11:27 AM
lriddick,
In order to accomplish what you wish to do, you will need to decouple your File I/O from your Data Acquisition.
To do so, you will remove the automatic DAQmx TDMS logging from the code, keeping only keep the data acquisition parts.
On the user interface, create a pause/play button that when clicked, toggles a global flag for file logging on/off, and increments a file number count for the path. In the section of code that is continually doing data acquisition, you will check this flag. If the flag is true, then you will append this data to a .TDMS file using the CVI TDMS functions located at Libraries > TDM Streaming Library. Specifically the Object Management and Data Storage functions.
There is a good example that shows how to use the TDM Streaming Functions at Example Finder > Fundamentals > File Input and Output > tdmsWriteBenchmark.cws