02-16-2010 01:32 PM
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.
Solved! Go to Solution.
02-16-2010 02:53 PM - edited 02-16-2010 02:53 PM
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.)
02-17-2010 03:17 PM