LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving value only once when condition is true

I have problems when i am trying to save value to file. How i can just save value to file(spreadsheet etc.) when condition is true and only once.
Program should continue normally, so it must happen in background.
0 Kudos
Message 1 of 2
(2,848 Views)
Depends on whether you are initiating the file save with a front panel boolean, or programatically. If it is with a front panel boolean, just have it enable a case structure with the save (either to file, or spreadsheet) in the true case. Also in this case, put a local variable from the boolean, tied to a false constant to reset the boolean.
IF you are waiting for a programatic true condition, then use a short time one-shot between the programatic true and the condition terminal of the loop. It sometimes helps to put a short time delay in the true condition case as well. I use a one-shot with a 10 ms. output pulse, and put a 10 ms time delay in the true case. That way, you are assured that you don't save twice for one false-to-true transition of the programatic boolean.

Good luck

Dave
0 Kudos
Message 2 of 2
(2,843 Views)