09-10-2018 01:59 PM
Hello everyone,
I am new to labview so the question I have is probably going to be extremely easy for you.
I am working with a software to acquire data, I would like my software to save data as well. What I want is a "save" button that once pressed starts saving and a "stop saving " button to terminate the saving without interrupting the data display. At the moment I have the save part inside a while loop (that can be stopped by another stop button), but I am only able to save data if the save button is already pressed before running the program. Ideally I would like my program to be able to save also if I start saving data after the program is already running.
I hope someone could help me,
Thank you very much in advance!
Best Regards,
Meggy
09-10-2018 02:40 PM
Meggy,
Bob Schor
09-10-2018 02:52 PM - edited 09-10-2018 03:04 PM
@meggy92 wrote:
..., but I am only able to save data if the save button is already pressed before running the program.
That makes no sense. You are reading from a local variable that always returns the current control state.
The code you show with that unknown subVI is labeled as "create data file". Maybe you should find the location elsewhere that "saves the data" to that created file and also make it dependent on that same boolean.
Your problem might be that if you switch later, the file never gets created because that code has already executed.
(I won't comment on the code, because we only see a tiny fraction. For more specific help, attach the VI)
09-11-2018 05:58 AM
Hi,
To clarify, do you want to have a button which logs data to file when it is pressed? This is probably relatively simple. You probably have a data acquisition loop. Put a case structure, operated by a Log Data button. Inside the case structure will be a logging vi that writes the data acquired in the current loop to a file. The file open/close functions will be added outside of the acquisition loop as necessary.