⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 protectoc_back_accelerate.c

📁 电力系统中的保护装置全部代码
💻 C
📖 第 1 页 / 共 2 页
字号:
 	//------------------------------------------------//
//报告通道
    //pReport->pro_channel_number = 1; 
     
//////保护私用变量
// ----------------------------------------------------- //  	         
    pProtect->pro_startup_flag    =    0;
    pProtect->pro_pickup_flag     =    0;	
    pProtect->pro_reserve1    =    0; 
    pProtect->pro_reserve4    =    TMD_System_Clock; 
	
}

///////////////////////////////////////////
/////////////// 保护执行函数 ////////////////
///////////////////////////////////////////

void	OC_ACC_Routine(PROTECT *ptr)
{
PROTECT         *pProtect,*pReclose; 
SETTING         *pSets; 
SOE             *pSoe; 
VALUE           *pValue;
REPORT          *pReport;
JUMPER          *pJumper; 
TIME            *pTime;
INT             SetZoneNum;

float           Ia_Value,Ib_Value,Ic_Value;
float           Current_Set,Time_Set,Mode_Set;

UNSIGNED        *Delay_Time;

extern	PROTECT	protect_Reclose;
UNSIGNED        *ACC_Flag,*Reclose_Flag,*Charge_Flag;
// ----------------------------------------------------- // 

    pProtect = ptr;

//指针赋值
    Delay_Time	 =    &pProtect->pro_reserve4;
    pReclose 	 =    &protect_Reclose;
    ACC_Flag 	 =    &pReclose->pro_reserve1;//加速标
    Reclose_Flag =    &pReclose->pro_reserve2;//重合闸标
    Charge_Flag  =    &pReclose->pro_reserve3;//充电标

//////取定值
// ----------------------------------------------------- // 
//定值区号
    SetZoneNum    =    iLONC_SetZoneNum;
    pSets         =    pProtect->pro_setting; 
   //------------------------------------------------//        
//电流
    Current_Set   =    pSets->set_value_zone[SetZoneNum];
    pSets++;
//时间        
    Time_Set      =    pSets->set_value_zone[SetZoneNum];
    pSets++;
//方式
    Mode_Set      =    pSets->set_value_zone[SetZoneNum];  //0为后加速
    pSets++;

//////实时数据
// ----------------------------------------------------- // 
//数据通道
    Ia_Value    =    AIChn[PIa_Chn].chl_value1;
    Ib_Value    =    AIChn[PIb_Chn].chl_value1;
    Ic_Value    =    AIChn[PIc_Chn].chl_value1;
//数据传递
    pValue      =    pProtect->pro_run_data;  
   //------------------------------------------------// 
//A相电流  
    pValue->value_measure    =    Ia_Value;
    pValue++;        
//B相电流  
    pValue->value_measure    =    Ib_Value;
    pValue++;           
//C相电流  
    pValue->value_measure    =    Ic_Value;
    pValue++; 

//////保护逻辑
// ----------------------------------------------------- // 

//压板指针
    pProtect->pro_jumper = OC_ACC_jumper;
    pJumper = pProtect->pro_jumper;  
//保护退
    if (!(DOChn[BSJ].state))
        return; 
    if(!pJumper->jum_status)
    {
        ClearFlag(ptr);
        return; 
    }   

//电流元件
    if(Ia_Value < Current_Set && Ib_Value < Current_Set && Ic_Value < Current_Set)
    {
                NoStartup(pProtect); 
        pProtect->pro_reserve5 = TMD_System_Clock;
        return;
    } 

//去干扰
    if(EraseBurr(ptr))
        return;	
	
//启动
    if(StartPro(pProtect))
        return;
//前加速
    if(Mode_Set)
    {
        if((*Charge_Flag == 0) && (*Reclose_Flag == 1))return;
        if((*Charge_Flag == 0) && (*Reclose_Flag == 0) && (*ACC_Flag == 0))
        return;   
	    		
        if(TMD_System_Clock - *Delay_Time < Time_Set*1000)  
            return;
        if(DOChn[TZJ].state)
        {
	    *Delay_Time = TMD_System_Clock;
	    return;
        }	

//动作元件
        pProtect->pro_pickup_flag = 1;
        Qdj();			//跳闸子程序
        Tzj();
        pProtect->pro_reserve5 = TMD_System_Clock - pProtect->pro_reserve5;
		    
//报告
        pReport = &ACC_Report;
//SOE				    	
        pSoe = &pReport->pro_report_soe;            	  	
       //------------------------------------------------//
        pSoe->pSOE_name = "过流前加速跳闸"; 
        strcpy(pSoe->SOE_name,pSoe->pSOE_name);         
        pSoe->Relative_Time = pProtect->pro_reserve5;
        READ_DEC_TIME(&pSoe->Year);
//        pSoe->Fault_Number = SOENumber++;
//动作值
        pValue = pReport->pro_report_data;
       //------------------------------------------------//   
        pValue->value_measure     =       Ia_Value;
        pValue++; 
       //------------------------------------------------//
        pValue->value_measure     =       Ib_Value;
        pValue++;
       //------------------------------------------------// 
        pValue->value_measure     =       Ic_Value;
        pValue++; 
       //------------------------------------------------//
        pReport->mmi_flag = MMIDISPLAY + MMIPICKUP;
        Fill_Report(pReport);
    }
//后加速
    else
    {
        if(*ACC_Flag == 0)return;
        if(TMD_System_Clock - *Delay_Time < Time_Set*1000)  
            return;
        if(DOChn[TZJ].state)
        {
            *Delay_Time = TMD_System_Clock;
            return;
        }

//动作元件
        pProtect->pro_pickup_flag = 1;
    	Qdj();			//跳闸子程序
   	Tzj();
        pProtect->pro_reserve5 = TMD_System_Clock - pProtect->pro_reserve5;
		    
//报告
        pReport = &ACC_Report;
//SOE				    	
        pSoe = &pReport->pro_report_soe;            	  	
       //------------------------------------------------//
        pSoe->pSOE_name = "过流后加速跳闸";
        strcpy(pSoe->SOE_name,pSoe->pSOE_name);          
        pSoe->Relative_Time = pProtect->pro_reserve5;
        READ_DEC_TIME(&pSoe->Year);
//        pSoe->Fault_Number = SOENumber++;
//动作值
        pValue = pReport->pro_report_data;
       //------------------------------------------------//   
        pValue->value_measure    =    Ia_Value;
        pValue++; 
       //------------------------------------------------//
        pValue->value_measure    =    Ib_Value;
        pValue++;
       //------------------------------------------------// 
        pValue->value_measure    =    Ic_Value;
        pValue++; 
       //------------------------------------------------//
        pReport->mmi_flag = MMIDISPLAY + MMIPICKUP;       
        Fill_Report(pReport);
    }
					
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -