LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create new file with timestamp each time a button click is true

Hello,

 

I am trying to create a timestamped file (to prevent overwriting files) each time a button is clicked. I only want a new file to get generated when "Save data" changes from False to True and not when it changes from True to False. Once the file is generated, I want to continuously write to the file until the button is clicked again (Save data = False). I've attached an example of what I'm trying to do but can't get the path to update correctly. I've tried sending the updated path via a notifier but there is an error running the program because the path doesn't exist yet.

 

Does anyone have advice on how to do this? Any help is greatly appreciated.

0 Kudos
Message 1 of 2
(798 Views)

I suggest you start looking into a Queued Message Handler architecture.  It is similar to a Producer/Consumer, but it sends commands instead of raw data.  One of the commands should be "Start Record", which tells the QMH to create a new file and set a flag to save the data.  Another command can be "Stop Record", which closes the file and clears the record flag.  Finally, there should be a "Close" command telling the QMH to close all of its references and stop.  My trick is to use the queue's timeout to perform the repeated action.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 2
(768 Views)