LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change boolean value for defined time when button pressed.(defined latch time?)

Solved!
Go to solution

Is it possible to define a latch time in LabVIEW? Rather than changing the boolean value for just one sample, I need the value changed for 0.05 seconds. This problem seems very simple but my programming skills are failing.

 

To simply explain what my program does, it simulates a sine wave when one button is switched. I then have the amplitude of the sine wave controlled by another case structure within the master case structure (if I can call it that). The false value for the amplitude case structure is 5. When a button is pressed, I need the case structure to change to true for 0.05 seconds, changing the amplitude to 10. The case structure then needs to revert back to false and generate its original amplitude of 5.

 

Can this be programmed very simply? If only I could have a latch for defined time button.

0 Kudos
Message 1 of 3
(5,400 Views)
Solution
Accepted by topic author mark308

Yes.  When the button is true, store the current time into a shift register (if false, pass the shift register wire through unchanged).  Each loop iteration, compare the current time to the shift register time.  If the different in values is less than or equal to .05, then run the true case of your amplitude case structure.  (Actually, I wound up using Select statements for this example.)

 

Message Edited by Ravens Fan on 02-16-2010 03:53 PM
Message 2 of 3
(5,390 Views)
Thanks a million. I'm new to programming and have never used shift registers or the select function (I guess really new to programming!). After learning how your program executed, I was able to implement the same logic and it works!!!! Thanks again.
0 Kudos
Message 3 of 3
(5,365 Views)