#RE_B2(CLK := #B2); #RE_Run(CLK := #Start_stop); #FE_Run(CLK := #Start_stop); #Gone_3m(IN := (#State = #RunP12) and not #Reset, PT := T#3M);
if #Gone_3m.Q then #Light := true; end_if;
if #Reset then #Light := false; end_if;
case #State of #Ready: if #RE_Run.Q then #State := 1; end_if; #Idle: #P1 := #P2 := false; if #FE_Run.Q then #State := #Ready; elsif #RE_B2.Q and not #P1_Last then #State := #RunP1; elsif #RE_B2.Q and #P1_Last then #State := #RunP2; elsif #B3 then #State := #RunP12; end_if;
#RunP1: #P1 := true; #P1_Last := true; if (not #B1) or #B3 or #FE_Run.Q then #State := #Idle; end_if; #RunP2: #P2 := true; #P1_Last := false; if (not #B1) or #B3 or #FE_Run.Q then #State := #Idle; end_if; #RunP12: #P1 := #P2 := true; if (not #B1) or #FE_Run.Q then #State := #Idle; end_if; end_case;