LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switch Boolean Control to False Automatically after set time

Solved!
Go to solution

I am trying to control when I record data by having the user press a Boolean control on the front panel. I want the data to record for 3 seconds only and then have the Boolean control automatically turned to false so that the data stops recording and the control changes on the front panel but doesn't stop the execution of the VI. The reason is I want to have the user create a log file of settings for a laser operated outside of labview where the user inputs via numerical controls the current laser settings and the reading from a laser wavelength meter is recorded measured and recorded in labview. So after the data records for 3 seconds the user would input new settings for the laser and then record the new output from the wavelength meter setup, and repeat this multiple times. 

 

I have tried a case strucutre as seen in the VI attached and also have tried a state machine with ENUM control. I can't seem to get this thing to work. ANy help would be appreciated.

 

Thanks

0 Kudos
Message 1 of 5
(4,402 Views)
Solution
Accepted by topic author DanAlienware

Hi,

Easiest implementation is having a state machine. You'd have one state to collect data for a specific timer and another state to exit the VI.

 

 


Kudos are the best way to say thanks 🙂
0 Kudos
Message 2 of 5
(4,399 Views)

Take a look at the elapsed time express vi

0 Kudos
Message 3 of 5
(4,361 Views)

I didn't want to change totally your VI, so I just removed the sequences and some of the case structures. You probably need filename for the Write Stream VI.

There is a new loop which deals with the elapsed time, and some new indicators for debugging purposes only.

0 Kudos
Message 4 of 5
(4,334 Views)

Small change. I put by mistake the wait function in the case structure in the main loop. By the way, your VI is using files from the LabVIEW examples folder. You may need to point to the proper location of the files when loading the VI, if your Windows version is 32-bit

0 Kudos
Message 5 of 5
(4,321 Views)