You can copy the input valve and connect it at the output of the tank.
It will be a boolean control , at which you will have full control.
When the boolean will be ON you should decrease the tank value, by a step for each itteration of the wile loop (according to time).
(It is the most regular. It can be according to other things)
Be more spesific if you need more info.
What kind of control you need, what are the parameters of your program, or post your vi.. even if it does not work