Showing results for 
Search instead for 
Did you mean: 

Energizing the relay at timed cycles



I am trying to introduce a cyclic pressure into a line by opening/closing two solenoid valves for different time intrvals. To state it more simply, let's assume that I need to open/close one solenoid valve every 3 seconds (open for 3 seconds/ closed for 3 seconds/ Repeat). This cycles are to be performed until a low pressure is observed for more than 6 seconds (i.e. sample failure). If it helps, I am using a Ni 9485 to energize the solenoid valve and I am using a pressure transducer and a NI 9205 to monitor the pressure. Based on my research I think I need to use a simple timed while loop and a state machine. Yet, I am totally new to the LabView and unfortunately I do not get enough time to study the whole while loop and state machine subjects. I would appreciate it if some one can guide me a little bit or send me a similar example. I don't know why I cannot find any simple cyclic timed while loop online.




0 Kudos
Message 1 of 4

It sounds like you are wanting to control digital outputs in 3 second increments until the analog input reads below a certain threshold for 6 seconds.


To implement this you would want to have your program alternate between on/off digital outputs on a line and read analog inputs in parallel.  DAQmx ships with several examples of how to write digital lines and read analog inputs which should be helpful in getting you started.


You can check out the following community examples as starting points for writing digital outputs (with some timing control in the loop) and reading analog inputs:

Community: Write Digital Channels

Community: Voltage - Continuous Input


Also, you might find the snippet below useful as a possible method of monitoring a value to see when it has been below a threshold for 6 seconds.  In this snippet, the VI ends if the adjustable front panel control "Gauge" is below 25 for more than 6 seconds.


wait for threshold.png


Paul P.

Applications Engineer

National Instruments

Highest Regards,

Message 2 of 4

Here is that snippet in 2015.


wait for threshold.png

Highest Regards,

Message 3 of 4

That was a huge help. Thanks a lot.

0 Kudos
Message 4 of 4