LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS File Viewer cannot find file

Solved!
Go to solution

The VI I currently use is a slight modification of the ContAcq&GraphVolt example.  I recently upgraded to LabVIEW 2009, and my TDMS Viewer will no longer open the TDMS files I record.  The files are there, and I can open them using the ReadTDMS example VI, but the viewer in my block diagram gives me Error 7: Cannot find file.  There is one caveat, though.  If I am recording over a file I had previously created, the viewer will find the file.  So if I record file test1.tdms, the first time it will display an error finding the file, but the second time I record test1.tdms the viewer will find the file.  Any ideas as to why this is happening?

Since my VI is pretty close to the ContAcq&GraphVolt example (which also does not work at the moment), troubleshooting this VI will solve my problem.

0 Kudos
Message 1 of 14
(4,168 Views)

Are you SURE you are closing the TDMS file?

 

The data for a TDMS file is only written to disk when it is closed or flushed(?).

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 14
(4,164 Views)

Yes, the TDMS file is closed prior to the TDMS Viewer being called to open the file.

0 Kudos
Message 3 of 14
(4,161 Views)

Post your code so we can look.

 

The description you have reported is one of the classic symptoms of a Race Condition.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 14
(4,158 Views)

My VI is attached.  As I said, only slightly modified from the ContAcq&GraphVolt VI.

Thanks for the help.

0 Kudos
Message 5 of 14
(4,155 Views)

Sorry but I only have LV 7.1 on this mahcine and my shared drive crashed yesterday so can you post an image?

 

Otherwise I'll have to let other chip in.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 14
(4,153 Views)

Attached is a PNG image of the block diagram.  It's just what my computer decided to use to print the image; let me know if I need to save it as another file type.

0 Kudos
Message 7 of 14
(4,149 Views)

 

 

Sure looks like the file is not not showing up on disk unitl later.

 

As a quick test try

 

1) putting break point before the TDMS Viewer (between 9 and 10).

 

2) Let the break point fire then look for the file using explorer.

 

3) after you see it in Explorer, un-pasue the VI and see if the viewer finds it.

 

All of the above is based on obersvations that files writen to disk can sometime not show up if we turn around try to open them. i ahve understood this as being due to the file system being a little behind in sharing updae to folders.

 

Just trying to help,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 14
(4,132 Views)

Putting the breakpoint right before the TDMS File Viewer didn't help.  I was able to see the new file using Explorer, then once I continued the VI it still brought up the 'cannot find file' error.

Does LabVIEW have a default file path somewhere that I could set?  My only other thought is that 2009 is looking for files in a different place than 8.5 was, but I am setting the file name/path each time I run the VI.

0 Kudos
Message 9 of 14
(4,128 Views)

opening your VI on a LV 2009 machine results in a dialog looking for files (see note #4 in your code) in your 8.6 folder so there may be soething to your theory about differences.

 

I forced mine to use the VI from the 2009 examples and it runs without the erro = 7 you have reported.

 

Another concern I should share is the possiblity you have managed to cross link VI between 8.6 and 2009.

 

That is all I can offer at this time. Please share if you figure out what happened.

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 14
(4,123 Views)