08-29-2013 10:39 PM
Hey guys,
I have a program that controls a ventilator which pumps in gas at a certain rate. This whole process is executed in a while loop. When we switch gases by a toggle that's on the front panel, we'd like to skip one ventilating cycle immediately and then goes back to pumping gases at the previous rate, but we don't know how to realize this. Can you guys give any advices? Thank you!
Sincerely,
Le Z.
Solved! Go to Solution.
08-29-2013 10:43 PM
08-29-2013 10:54 PM
Thanks for the suggestion. I've uploaded the code. The part I'm talking about is the case structure labeled with HP or N2
08-30-2013 01:25 PM
Hello Le,
If I am reading this right, it sounds like you may want to change the mechanical action of your switch. Currently, it is set to "switch when released." This action will cause the button to output a "true" signal even after you click it. I would instead suggest using a latch when released mechanical action. One "true" signal will be sent to the case structure once the button is released. Then the button will return to it's default false position. Here is a KB that explains this in more detail:
http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/changemechactofboolswitch/
-Erik S
08-30-2013 03:13 PM
Thanks for the suggestion, but maybe I didn't explain it very well. So let's say that it's now on N2 (hence false state),then I press the HP button, it will skip one iteration inside the case structure, then it will switch to the true state (HP), and it will stay there until next time HP button is pressed. Is there any way to achieve this?
08-31-2013 07:30 PM
Make sure the mechanical action for the HP button is set to Latch When Released. The button will automatcially reset when the terminal is read that way.
09-03-2013 06:00 PM
Hello Le,
A shift register in your loop may be able to achieve this type of functionality. If you wire the switch into the right shift register and wire the left shift register into the case structure, the loop should iterate one more time before switching to HP Gas. Here is a link to a tutorial on shift registers:
http://www.ni.com/gettingstarted/labviewbasics/shiftregisters.htm#Shift Registers
-Erik S
09-06-2013 09:18 AM
Thank you all for your insights! Now it's working in the way we want it to