From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean on/off on given set time.

Solved!
Go to solution

Hi all,

 

I have LabView set up to output a signal from my USB-6501. The output signal triggers a relay and turns a solenoid valve on/off. 

 

Currently I have a Boolean set up as a button where I click to turn the signal on, and click to turn it off. In turn the valve opens, and then closes.

 

I'm extremely inexperienced with Labview and was able to search enough to set this up, but it is difficult for me to convert what others with similar, but different set ups, have done from searching the forum. 

 

What I'm having trouble with now is modifying this code in order to have clicking on the Boolean button output the signal for a set amount of time (say 500ms) and then automatically turn off (without having to reclick). Basically a pulse. I feel like it would involve loop of some sort set with a timer, but am unsure how to start setting this up.

 

I've attached my LabView code for you to see. I would greatly appreciate any help. Thanks in advance.

0 Kudos
Message 1 of 3
(4,285 Views)
Solution
Accepted by topic author zakzackzachary

I recommend using an Event Structure.  On the boolean value change, you set or reset the output.  Using a shift register, you can also set the timeout for the event structure.  Then in the timeout, use a Value (Signaling) property of the boolean to force a value change on the boolean to false.  This will cause that boolean value change event to trigger and therefore cause your output to turn off.


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
Message 2 of 3
(4,249 Views)

 

Your modification to my code works great. I'm going to pick it apart to learn more about what you did as well. Thanks!

0 Kudos
Message 3 of 3
(4,243 Views)