LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HOW TO CONTROL TWO LIMIT SWITCH WITH ONE WATER PUMP AND ONE SOLENOID VALVE?

I am attempting to write a program in LabView interface with Arduino (using LINX) which will turn a pump on or off based on the water level in a container.  I am using a floatation device along with limit switches (something like an electronic version of a toilet float switch) which I would like to use to signal the pump to turn on or off.  When the bottom limit switch is triggered, I want the pump to turn on and remain on until the top limit switch is triggered.  When the top switch is triggered, I want the pump to turn off until the bottom switch is triggered. Same goes with solenoid valve, when limit switch bottom switch triggered the solenoid valve will be on/off and remain on until the top limit switch is triggered. If anyone can help me to settle this problem.  I am still learning LabView, so simplicity in answering would be appreciated.  Thank you.1 - solenoid valve1 - solenoid valve2 - limit switch/float switch2 - limit switch/float switch1 - dc water pump1 - dc water pump

0 Kudos
Message 1 of 2
(2,802 Views)

I think a good way to approach this problem is with a State Machine.

 

You have several cases, and have already described how they should be linked together.

 

The link above should provide some tips to creating a State Machine in LabVIEW. It's important to use a typedef for your States! Create this beforehand - that way you won't get block diagram constants that are not linked.

 

Inside the cases, you'll need the hardware specific code to activate and deactivate pumps and valves - do you already have this working? If so, great. If not, consider using simple VIs to test that code separately and use SubVIs to modularize the functionality.


GCentral
0 Kudos
Message 2 of 2
(2,744 Views)