while(1){ if(i > 50000){ if(One_Shot == 0){ FC321_Reset(); One_Shot = 1; }else{ FC321_GetTimeSec(&time); if(time > 5){ One_Shot = 0; i = 0; } } }else{ i++; } }//while(1)
while(1) { /* If there has a been a successful rack in and rack out procedure increment the number of complete racking cycles by 1 */ if(Successful_RackIn && Successful_RackOut){ Cycles_Complete++; Successful_RackIn = 0; Successful_RackOut = 0; } /* If the Close button is pushed on the HMI and the breaker is either racked in or racked out, and open, allow the breaker to close */ if(HMI_Close){ if(PS_In && !PS_Out){ if(!Rack_MOC_NO && Rack_MOC_NC){ Enable_Close = 1; } }else if (!PS_In && PS_Out){ if(!Rack_MOC_NO && Rack_MOC_NC){ Enable_Close = 1; } } } /* If the breaker is allowed to close, allow 2 seconds to elapse for the mechanical closing of the breaker */ if(Enable_Close){ if(One_Shot == 0){ FC321_Reset(); One_Shot = 1; Close_BKR = 1; }else{ FC321_GetTimeSec(&Time_Close); if(Time_Close > 2){ if(Enable_Close){ Enable_Close = 0; One_Shot = 0; } } } } if(i > 5){ if(One_Shot == 0){ FC321_Reset(); One_Shot = 1; }else{ FC321_GetTimeSec(&time); if(time > 5){ One_Shot = 0; i = 0; } } } if(i > 10){ Enable_Close = 1; i = 0; }else{ i++; } }//while(1)
Message Edited by Joxer on 2007-02-1408:48 AM
Message Edited by Joxer on 2007-02-1408:49 AM