LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write to multiple data files

Hello all,

 

So I have built this VI for my research and we are now beginning to run very long experiments (24+ hours). My question is how do I separate my output file into multiple files so that I don't end up with ridiculous text files? I am having trouble doing this using the write to text file VI, I know there is an option to do this in the express VI but that slows down my program too much..

 

Attached is a screenshot of the current VI, how would I change this so that it starts writing to another file after say 2 hours or after a pre-determined number of cycles for the while loop?

 

Thanks a lot,

Luca

0 Kudos
Message 1 of 3
(3,066 Views)

The easiest way that I have been able to do this is using the date/time in the file name that you are writing to. You are going to need to add a bit more to your program that can control all of your timing and file generation. As I cannot see inside of your express VI, how frequently is the loop acquiring data?

0 Kudos
Message 2 of 3
(3,040 Views)

Instead of writing to text files, I recommend using the DAQmx Configure Logging on your task to have the data streamed to a TDMS file.  You should have a add-in for Excel to open up those files.  If you then dig into the properties of the DAQmx Read, you will find a property to limit the number of samples that go into a single file.  DAQmx will automatically create a new file when the current one reaches that many samples.

 

This will greatly reduce the amount of work you will need to do in your program.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 3
(2,996 Views)