11-12-2019 11:31 AM
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!
11-12-2019 11:57 AM
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!
11-12-2019 01:46 PM
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.