LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you you create, write, and save files?

I created a VI to read 8 channels and display the waveform, which it does. But whenever I try to set up a way to save the data it never works. I want it to give me the option to create a new file, then write the data to there, and save it, and then close the file. How should I go about this?
0 Kudos
Message 1 of 8
(3,953 Views)
This should be no problem at all. Show us your code and we tell you what's wrong. 🙂
Message 2 of 8
(3,951 Views)
I am not sure whether I want to use a "write to measurement file" or just a text file, and how to integrate it into the code. I do want to be able to open the saved file in MS excel.
0 Kudos
Message 3 of 8
(3,947 Views)

I have not opened your attachment, yet.

Before doing so, you will need to decide if you want to write to:

a) a measurement file

b) a regular text file, or

c) MS Excel Spreadsheet

 

The method to write to the above are quite different.  Please decide and let us know..

 

R

Message 4 of 8
(3,940 Views)
A Measurement file is fine.
0 Kudos
Message 5 of 8
(3,938 Views)

First, your Write to Measurement File creates a text file with the lvm extension. This can be opened just fine in Excel. Second, you have it outside the while loop. By doing this, you are only passing the results from the very last iteration of the loop. So, move it inside the loop. If you want the user to be able to select the file, you can place a file control on the block diagram or let the Write to Measurement File prompt the user and then use a shift register for the selected file name. Otherwise the user will get prompted every iteration.

 

You have a lot of other options for saving the data. Most of the others will be faster and more flexible than the Write to Measurement File. Look through the shipping examples.

Message 6 of 8
(3,915 Views)
That seems to have worked, so thanks! Are there any specific things you recommend in the "configure write to measurement file" window to check off? It seems like I have to keep going back and adjusting it to ask user to choose file, which I would like to automatically happen, cause I want the user to either be able to choose a file to write over, so to create an entirely new file.
0 Kudos
Message 7 of 8
(3,903 Views)
I have the program now saving to a measurement file, which is great! I was wondering if there was a simple way for the data that was taken to be acquired and redisplayed on the graph window of the front panel? (so, basically to show what was shown while the data was being collected...)
0 Kudos
Message 8 of 8
(3,858 Views)