LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving Live Data on Command

Hi All,

 

I have a pretty simple concept that I'm trying to turn into a VI. I am measuring a voltage signal through a digital lock-in amplifier which sends the signal to my computer. I've successfully plotted the signal vs. time and have a working code that even lets my save this data. 

 

Next I want to be able to save particular bits of my data, in real time, to a new file. For example, I will be measuring this voltage in real time while I change a parameter of the system that produces the signal. This should cause my plot to spike to a new voltage value and then remain at this voltage until I change the parameter again. 

 

Is it possible for me to press a button and have LabView save the data that's gathered until I press the button again? Could I do this multiple times throughout the run that way I can have multiple data sets corresponding to multiple values of the parameter?

 

Thank you!

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

Hi emullen,

 


@emullen98 wrote:

Is it possible for me to press a button and have LabView save the data that's gathered until I press the button again? Could I do this multiple times throughout the run that way I can have multiple data sets corresponding to multiple values of the parameter?


The answer to both questions is YES!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(1,823 Views)

It's pretty common to use an event structure inside a while loop to look for button presses or value changes. You can use the timeout case of the event structure to update your data / graph.

To generate your filenames you can use "Format into string" with a format like "Parameter_%d.txt". Once you wire a numeric, for example 200, the actual output string will read Parameter_200.txt. If you are going to visit the same parameter value more than once in, then you will need some other unique specifier, like a timestamp.

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