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

📄 promeasure.c

📁 电力系统中的保护装置全部代码
💻 C
字号:
/********************************************************************************/	
/*                                                                       	*/
/* FILE NAME                                            VERSION          	*/
/*                                                                       	*/
/*  PT.C                                           PLUS  1.0        	        */
/*                                                                       	*/
/* COMPONENT                                                             	*/
/*                                                                       	*/
/*      MEASURE   ---  measure I,U,P and Q  routine                             	        */
/*                                                                       	*/
/*                                                                       	*/
/*                                                                       	*/
/* DESCRIPTION                                                           	*/
/*                                                                       	*/
/*      This file contains measure routine   	                        	*/
/*                                                                              */
/*                                                                              */
/*                                                                       	*/
/* AUTHOR                                                                	*/
/*                                                                       	*/
/*      HuaiShengFei                   					 	*/
/*                                                                       	*/
/* DATA STRUCTURES                                                       	*/
/*                                                                       	*/
/*      None                                                             	*/
/*                                                                       	*/
/* FUNCTIONS                                                             	*/
/*                                                                       	*/
/*      MEASURE            the measure routine	                         	*/
/*                                                                       	*/
/* DEPENDENCIES                                                          	*/
/*                                  	                                     	*/
/*      PRO_defs.h                      Protect Data Structure Constants     	*/
/*                                                                       	*/
/* HISTORY                                                               	*/
/*                                                                       	*/
/*      NAME            DATE                    REMARKS                 	*/
/*                                                                       	*/
/*      FHS            02-4-4 14:20      Created initial version 1.0      	*/
/*                                                                       	*/
/*                                                                       	*/
/********************************************************************************/
#include        "BaseVariable.h" 
#include	"Promeasure.h"
void  Measure_Initialize(PROTECT *ptr)
{
   PROTECT         *pProtect;
   VALUE           *pValue;
   JUMPER          *pJumper;
   // ----------------------------------------------------- // 
   //保护结构体指针赋值
   pProtect = ptr; 
   //保护缓冲区指针赋值
   //pProtect->pro_setting     =    Measure_setting;		
   pProtect->pro_run_data    =    ProMeasure_rundata;    
   //保护ID号
   pProtect->pro_id = PRO_Total_Protect;
   //保护装置名
   pProtect->ppro_device_name = "WXH-821";     
   //保护名
   pProtect->ppro_name = "测量";
   //跳闸位
   pProtect->pro_trip = 0;
   //压板个数
    pProtect->pro_jumper_number       =    0;
    //定值个数                        
    pProtect->pro_setting_number      =    0;  //没有定值
    //实时参数
    // ----------------------------------------------------- // 
    pProtect->pro_run_data_number    =    0;
    pValue                           =    pProtect->pro_run_data;
    //------------------------------------------------//  
    pValue->value_index_number    =    ++(pProtect->pro_run_data_number); 	
    pValue->pvalue_name           =    (CHAR*)strcpy(pValue->value_name,"A相测量电流");       	                                  
    pValue->pvalue_alias          =    "IA";	
    pValue->value_calculate_style =    CHL_MUL_;  
    pValue->pvalue_dimension  	  =    "A";  
    pValue->value_calculate_coefficient =    1; 
    pValue->value_measure               =    0.0; 
    pValue++;
    //------------------------------------------------//  
    pValue->value_index_number    =    ++(pProtect->pro_run_data_number);
    pValue->pvalue_name           =    (CHAR*)strcpy(pValue->value_name,"C相测量电流");        	                                  
    pValue->pvalue_alias          =    "IC";	
    pValue->value_calculate_style =    CHL_MUL_;  
    pValue->pvalue_dimension      =    "A";  
    pValue->value_calculate_coefficient =    1; 
    pValue->value_measure               =    0.0;
    pValue++;
    //------------------------------------------------//    
    pValue->value_index_number	  =    ++(pProtect->pro_run_data_number); 
    pValue->pvalue_name           =   (CHAR *)strcpy(pValue -> value_name,"AB线电压");
    pValue->pvalue_alias          =    "Uab";
    pValue->value_calculate_style =    CHL_MUL_;  
    pValue->pvalue_dimension      =    "V";  
    pValue->value_calculate_coefficient =    1; 
    pValue->value_measure 	        =    0.0;
    pValue++;                                              
    //------------------------------------------------//   
    pValue->value_index_number	  =    ++(pProtect->pro_run_data_number); 
    pValue->pvalue_name           =    (CHAR *)strcpy(pValue -> value_name,"CA线电压");
    pValue->pvalue_alias          =    "Uca";
    pValue->value_calculate_style =   	CHL_MUL_;  
    pValue->pvalue_dimension  	  =    "V";  
    pValue->value_calculate_coefficient =    1; 
    pValue->value_measure 	        =    0.0;
    pValue++;   
    //------------------------------------------------// 
    pValue->value_index_number	   =    ++(pProtect->pro_run_data_number); 
    pValue->pvalue_name            =    (CHAR *)strcpy(pValue -> value_name,"有功功率");
    pValue->pvalue_alias           =    "P";
    pValue->value_calculate_style  =    CHL_MUL_;  
    pValue->pvalue_dimension  	   =    "W";  
    pValue->value_calculate_coefficient =    1; 
    pValue->value_measure 	        =    0.0;
    pValue++;                                     
    //------------------------------------------------// 
    pValue->value_index_number	   =    ++(pProtect->pro_run_data_number); 
    pValue->pvalue_name            =    (CHAR *)strcpy(pValue -> value_name,"无功功率");
    pValue->pvalue_alias           =    "Q";
    pValue->value_calculate_style  =    CHL_MUL_;  
    pValue->pvalue_dimension  	   =    "Var";  
    pValue->value_calculate_coefficient =    1; 
    pValue->value_measure 	        =    0.0;
    pValue++;     
    //------------------------------------------------// 
    pValue->value_index_number	   =    ++(pProtect->pro_run_data_number); 
    pValue->pvalue_name            =    (CHAR *)strcpy(pValue -> value_name,"测量频率");
    pValue->pvalue_alias           =    "f";
    pValue->value_calculate_style  =    CHL_MUL_;  
    pValue->pvalue_dimension  	   =    "Hz";  
    pValue->value_calculate_coefficient =    1; 
    pValue->value_measure 	        =    0.0;
    pValue++;    
    //------------------------------------------------// 
    pValue->value_index_number	   =    ++(pProtect->pro_run_data_number); 
    pValue->pvalue_name            =    (CHAR *)strcpy(pValue -> value_name,"脉冲电度1");
    pValue->pvalue_alias           =    "W1";
    pValue->value_calculate_style  =    CHL_FREQ_;  
    pValue->pvalue_dimension  	   =    "KWH";  
    pValue->value_calculate_coefficient =    1; 
    pValue->value_measure 	        =    0.0;
    pValue++; 
    //------------------------------------------------// 
    pValue->value_index_number	   =    ++(pProtect->pro_run_data_number); 
    pValue->pvalue_name            =    (CHAR *)strcpy(pValue -> value_name,"脉冲电度2");
    pValue->pvalue_alias           =    "W2";
    pValue->value_calculate_style  =    CHL_FREQ_;  
    pValue->pvalue_dimension  	   =    "KWH";  
    pValue->value_calculate_coefficient =    1; 
    pValue->value_measure 	        =    0.0;
    pValue++;                                    
    //------------------------------------------------// 
    pValue->value_index_number	   =    ++(pProtect->pro_run_data_number); 
    pValue->pvalue_name            =    (CHAR *)strcpy(pValue -> value_name,"脉冲电度3");
    pValue->pvalue_alias           =    "W3";
    pValue->value_calculate_style  =    CHL_FREQ_;  
    pValue->pvalue_dimension  	   =    "KWH";  
    pValue->value_calculate_coefficient =    1; 
    pValue->value_measure 	        =    0.0;
    pValue++;                                    
    //------------------------------------------------// 
    pValue->value_index_number	   =    ++(pProtect->pro_run_data_number); 
    pValue->pvalue_name            =    (CHAR *)strcpy(pValue -> value_name,"脉冲电度4");
    pValue->pvalue_alias           =    "W4";
    pValue->value_calculate_style  =    CHL_FREQ_;  
    pValue->pvalue_dimension  	   =    "KWH";  
    pValue->value_calculate_coefficient =    1; 
    pValue->value_measure 	        =    0.0;
    pValue++;   
    //------------------------------------------------//                                                                                                                                              
    //无报告
    pProtect->pro_startup_flag    =    0;
    pProtect->pro_pickup_flag     =    0;	
}
/********************************************************************************/
/***************************protect execute**************************************/
/********************************************************************************/
void    Measure_Routine(PROTECT *ptr)
{
    PROTECT         *pMeasure; 
    VALUE           *pValue;
    // ----------------------------------------------------- // 
    pMeasure= ptr;
    pValue      =    pMeasure->pro_run_data;  
    //------------------------------------------------// 
    pValue->value_measure    =    fIA;
    pValue++;        
    pValue->value_measure    =    fIC;
    pValue++;           
    pValue->value_measure    =    fUAB;
    pValue++; 
    pValue->value_measure    =    fUCA;
    pValue++;        
    pValue->value_measure    =    fP;
    pValue++;           
    pValue->value_measure    =    fQ;
    pValue++; 
    pValue->value_measure    =    samp_f;
    pValue++; 
    
    pValue->value_measure    =    PulseCounter[0];
    pValue++;        
    pValue->value_measure    =    PulseCounter[1];
    pValue++; 
    pValue->value_measure    =    PulseCounter[2];
    pValue++; 
    pValue->value_measure    =    PulseCounter[3];
    pValue++; 
}

⌨️ 快捷键说明

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