04-04-2016 10:12 AM
Hello,
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.
Thanks,
Sia
04-05-2016 02:25 PM
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.
Paul P.
Applications Engineer
National Instruments
04-05-2016 03:12 PM
Here is that snippet in 2015.
04-06-2016 10:43 AM
That was a huge help. Thanks a lot.