Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Keeping a solenoid valve open for a certain amount of time

Solved!
Go to solution

Hi,

 

I have a NI 9472 with a solenoid valve attached. I developed a simple vi to actuate the solenoid valve (normally closed) when a pre-set pressure (i.e. voltage) is reached, i.e., the valve opens when the pressure exceeds the setpoint and closes when it decreases below the setpoint.  However, what I actually want the vi to do is to keep the valve open for a certain amount of time (say 1 sec), so that the pressure built-up can be fully released before the valve is closed, so then pressure is built-up from zero again and the cycle is repeated. I read some threads already but I haveen't found a answer that works for my application. Thanks for checking and looking forward for your help!

0 Kudos
Message 1 of 6
(6,194 Views)

It's hard to be certain without knowing exactly how your code works, but you may be able to use a Wait(ms) vi in your code.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(6,165 Views)

without looking at your code, you could do this...

 

Spoiler
WAIT_VI_BD.png

 

Spoiler
Example_VI_BD.png

 

0 Kudos
Message 3 of 6
(6,149 Views)

Sorry, I should have included my vi (see attached). 

 

The vi works such that when the voltage (controlled by a knob) reaches the set point, then the valve is opened. However, I don't know how I can keep the valve open for a 'certain' amount of time, regadless the voltage goes back immediately below the setpoint. This is to ensure that the pressure is fully released when I implement my real application.

 

Hope this helps!

 

 

 

0 Kudos
Message 4 of 6
(6,138 Views)
Solution
Accepted by topic author Rorrocornell

try this...make sure you put a wait function in your loop, otherwise you are using 100% of your CPU

 

Spoiler
Solenoid%20valve[1].png

 

Message 5 of 6
(6,135 Views)

Hi Apok,

 

That works! I'll try it with the pressure system and let you know how it goes.  Thanks!

0 Kudos
Message 6 of 6
(6,119 Views)