09-11-2009 09:59 AM
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.
Solved! Go to Solution.
09-11-2009 10:18 AM
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
09-11-2009 10:24 AM
Yes, the TDMS file is closed prior to the TDMS Viewer being called to open the file.
09-11-2009 10:34 AM
Post your code so we can look.
The description you have reported is one of the classic symptoms of a Race Condition.
Ben
09-11-2009 10:42 AM
My VI is attached. As I said, only slightly modified from the ContAcq&GraphVolt VI.
Thanks for the help.
09-11-2009 10:48 AM
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
09-11-2009 10:56 AM
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.
09-11-2009 11:10 AM
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
09-11-2009 11:33 AM
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.
09-11-2009 11:53 AM
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