A state machine will solve your problem. LabVIEW has examples of state machines that ship with it. Here is a contrived example but it should illustrate the basics.
Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion
"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot