03-16-2018 12:53 PM
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.
03-17-2018 12:12 AM
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.