LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open or make a copy of a tdms while running data acquisition VI

Hi everyone, 

 

I write my temperature data to tdms using DAQ and pc. At the end of the day the VI is set to close the tdms and create a new one after midnight.

 I want to copy the saved tdms files from previous days across to my usb drive but the VI would not let me do it or even open any tdms file while it is running. I want to have uninterrupted data acquisition while being able to have a look at data collected previously. Is there any way to access or transfer tdms files without stopping data AQ VI?

 

Thanks,

 

 

0 Kudos
Message 1 of 6
(3,965 Views)

It sounds like you are using DAQmx to automate logging to the TDMS file.  Is that correct?  If so, you will need to stop acquisition before opening the file in any way, including changing its position on disc (such as moving it to your flash drive).

 

There is no way to access or transfer any kind of file while LabVIEW (or any other application for that matter) has is open.  This is the same issue as trying to open or move an Excel spreadsheet while it is already open in Excel, which would also cause an error.  Since LabVIEW is writing to the TDMS file, another application, or even another instance of LabVIEW code cannot access the file.

 

You have a couple of options:

 

1) You could view the TDMS data in LabVIEW while the acquisition is occurring using a front panel control.

2) You could perform the TDMS datalogging separately from the data acquisition.  Perhaps in a producer consumer design pattern (http://www.ni.com/white-paper/3023/en/).  This would allow you to continue acquisition but pause logging while you view the file.  While the file is open, you could continue logging to a temporary file.  When you are done viewing the file, you would then append the contents of the temporary file to the end of the original TDMS file.

Cody A.
0 Kudos
Message 2 of 6
(3,919 Views)

can you open a closed tdms file in Excel while the program is running?

 

I can open any closed TDMS file in excel whileI have a labview program running.

0 Kudos
Message 3 of 6
(3,911 Views)

You can open a TDMS file at any time, as long as another program (such as LabVIEW) does not have it open.

Cody A.
0 Kudos
Message 4 of 6
(3,878 Views)

Thank you all for your replies, it seems like it was a temporarily problem with labview. I can now open any tdms file and even the file currently being written by my VI. 

0 Kudos
Message 5 of 6
(3,859 Views)

I have the same problem about openning the TDMS file while the VI is running. How did you solve it?

0 Kudos
Message 6 of 6
(3,628 Views)