filling and draining at the touch of a button

Suppose you filled your bags from a tank/barrel with known volume?