07-29-2024 03:04 PM
Hi all,
Labview newbie here. My goal for this project is to be able to have a program running, start recording data on a button click, stop recording data on a button click, be able to move the data files to a different location or rename them outside of labview (just using file explorer) while the VI is still running, and then do that any number of times without ever having to stop the VI. I've been using the Write to measurement sub vi and a True/False loop to start and stop recording on demand - this has been working great (see attached code). However, if I stop recording and then move or rename the existing files and then try to start recording again, my VI crashes and throws up this error (this happened in a slightly different VI but with all the same recording settings).
It almost seems like labview is searching for an existing file to write to, but with the settings I have it shouldn't need an existing file to write a brand new file.
Any help is appreciated!
Solved! Go to Solution.
07-29-2024 08:50 PM
Personally I would avoid using any express VIs.
I would recommend you use Producer/Consumer Read Waveform Data and Write to TDMS at Two Different Rates
NI-DAQmx has a built-in logging feature. Since you need to apply filtering before logging the data, a producer/consumer architecture would be more appropriate. For file name, I usually Set Filename with Current Date/Time
07-30-2024 08:55 AM
Thanks for the recommendation, but it doesn't solve my problem. I could learn how to program the backend of the express VI with the TDMS function, but that would be a whole other can of worms that I would then have to debug. Trying to debug the devil I know is better than trying to debug the devil I don't.
07-30-2024 02:10 PM
Just passing in True to Reset seems to work (moving/renaming the file doesn't cause Error 7) - it still appends to the file as well if that's how you've configured it.