LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I save data directly to a file from Labview

Hi guys,

 

I am able to save data from Labview in a tdms file. I want to overwrite the data each time I do a run. I would like to have a way to click a button on labview that will automatically save that run into a tdms file instead of me opening up the tdms file and saving the data for that run.That just takes time.

 

Thanks.

 

-Sicelo

0 Kudos
Message 1 of 9
(3,944 Views)

@Sicelo wrote:

Hi guys,

 

I am able to save data from Labview in a tdms file. I want to overwrite the data each time I do a run. I would like to have a way to click a button on labview that will automatically save that run into a tdms file instead of me opening up the tdms file and saving the data for that run.That just takes time.

 

Thanks.

 

-Sicelo



What do you mean by "instead of me opening up the tdms file and saving the data for that run"?  You mean you are getting a dialog box?  If you wire in a path constant, you won't have that issue.

 

Post some code so we can see what you mean.

0 Kudos
Message 2 of 9
(3,941 Views)

I guess my question is not clear enough.

I have attached the block diagram. Here is what I would like to do: I would like to have a button on the front panel which when I click will automatically save the data to a file I specify after I hit the stop button.

Here is what is happening right now. The data is being saved automatically whenever I run the vi. The "Write to Measurement File" function is configured in such a way that the data is saved in tdms format continuosly whenever the vi is running. I am overwriting the data in the file to prevent having so many individual files. But I would like to run the vi and decide to save it if I like the data it outputs rather than have me have to open the tdms file which is not connected to any icons in Labview to save the data.

 

Hope my question is clear now.

 

Many thanks.

 

-Sicelo

0 Kudos
Message 3 of 9
(3,931 Views)

The Write To Measurement File express VI has an input for the filename. Create a file path constant or control and wire that to the filename input. Edit the Action section and select Save to one file and what to do if the file exists. If you post the VI I would be able to tell what your settings are Smiley Happy

=====================
LabVIEW 2012


0 Kudos
Message 4 of 9
(3,918 Views)

Put the Write to Measurment file inside a case structure.

 

Have you taken the online LabVIEW tutorials?
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 5 of 9
(3,895 Views)

I understand what you told me but I am still not satisfied. Is there a way to click Save on the front panel of the VI and have a window pop up that asks you where you want to save your data rather than have the data be saved automatically?

 

Thanks

 

-Sicelo

0 Kudos
Message 6 of 9
(3,875 Views)

You can put the write to measurement file in an event structure.

=====================
LabVIEW 2012


0 Kudos
Message 7 of 9
(3,872 Views)

Thanks.

 

Can somehow summarize briefly for me how I can use the event structure to help me save data when I click on a button?

 

-Sicelo

0 Kudos
Message 8 of 9
(3,866 Views)

Create event structure.

Add a timeout time to top of event structure (not shown in attachment)

Right click on border

    choose add event

       Choose you control

       choose value change

 

Or see attachment.

0 Kudos
Message 9 of 9
(3,857 Views)