is it correct
OL_Point=Setvalue of current =30(unsigned int)
UC_point =set time=30(unsigned int)
Rph_Current,Yph_Current,Bph_Current are actual running current (Decalred as unsigned int)
OL_curve=1=20% of OL_point
OL_curve=1=50% of OL_point
OL_curve=1=100% of OL_point
Code:
if(((Rph_Current>OL_Point)||(Yph_Current>OL_Point)||(Bph_Current>OL_Point)))
{
if(OL_Curve==1)
{
Percenatge_Calculated= ((int)(OL_Point*percentage2C_Limit)+OL_Point);
if((Rph_Current>Percenatge_Calculated)||(Yph_Current>Percenatge_Calculated)||(Bph_Current>Percenatge_Calculated))
{
percentage2C_Limit=percentage2C_Limit-1;
Counter_OCRT--;
if(Counter_OCRT<=0)
{
Counter_OCRT=UC_Point;
OverLoad_Flag=1;
Hold = 0;
Hold_control=0;
}else
if(percentage2C_Limit==1)
{
percentage2C_Limit=20;
}
}
else
{
Counter_OCRT=UC_Point;
OverLoad_Flag=0;
Rph_OLFlag=0;
Yph_OLFlag=0;
Bph_OLFlag=0;
}
}
if(OL_Curve==2)
{
Percenatge_Calculated= ((int)(OL_Point*percentage5C_Limit)+OL_Point);
if((Rph_Current>Percenatge_Calculated)||(Yph_Current>Percenatge_Calculated)||(Bph_Current>Percenatge_Calculated))
{
percentage5C_Limit=percentage5C_Limit-1;
Counter_OCRT--;
if(Counter_OCRT<=0)
{
Counter_OCRT=UC_Point;
OverLoad_Flag=1;
Hold = 0;
Hold_control=0;
}else
if(percentage5C_Limit==1)
{
percentage5C_Limit=50;
}
}
else
{
Counter_OCRT=UC_Point;
OverLoad_Flag=0;
Rph_OLFlag=0;
Yph_OLFlag=0;
Bph_OLFlag=0;
}
}
if(OL_Curve==2)
{
Percenatge_Calculated= ((int)(OL_Point*percentage10C_Limit)+OL_Point);
if((Rph_Current>Percenatge_Calculated)||(Yph_Current>Percenatge_Calculated)||(Bph_Current>Percenatge_Calculated))
{
percentage10C_Limit=percentage10C_Limit-1;
Counter_OCRT--;
if(Counter_OCRT<=0)
{
Counter_OCRT=UC_Point;
OverLoad_Flag=1;
Hold = 0;
Hold_control=0;
}else
if(percentage10C_Limit==1)
{
percentage10C_Limit=100;
}
}
else
{
Counter_OCRT=UC_Point;
OverLoad_Flag=0;
Rph_OLFlag=0;
Yph_OLFlag=0;
Bph_OLFlag=0;
}
}
}
else
{
Counter_OCRT=UC_Point;
OverLoad_Flag = 0;
Rph_OLFlag=0;
Bph_OLFlag=0;
Yph_OLFlag=0;
}