LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Running and displaying daq data continuously while making different measurement's with tdms

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

 

0 Kudos
Message 1 of 4
(3,355 Views)

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:

 

  1. From the splash screen, launch the Example Finder by clicking the Find Examples... link.
  2. A new window will pop up. Navigate to Hardware Input and Output > DAQmx > Analog Measurements > Voltage > TDMS-ContAcq-IntClok.prj
  3. Double-click this file to launch the example.
  4. Copy the project and files to a new directory.
  5. Modify the example to allow the user to pause the writing to file.
Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,343 Views)

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?????

0 Kudos
Message 3 of 4
(3,338 Views)

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

Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,332 Views)