上传文件至 标准版4.0
This commit is contained in:
parent
ab1f9c0e6e
commit
0fb36100ac
34
标准版4.0/CRCC标准版本修改记录.txt
Normal file
34
标准版4.0/CRCC标准版本修改记录.txt
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
20150713
|
||||||
|
1.统一IO配置 20170217
|
||||||
|
2.修改馈线保护测距电抗值计算 20170616
|
||||||
|
3.修改通用测控装置程序,解决遥信B05_C4—B05_D15遥信变位上送两次的问题。
|
||||||
|
4.馈线测距增加自抗修正 20170720
|
||||||
|
5.数字化装置上送IO遥信 20170905
|
||||||
|
6.主变测控修改“桥隔备用方式”定值,3QS可以用作它用 20170914
|
||||||
|
7.常规馈线保护装置添加供电臂保护20171110
|
||||||
|
8.修改发送浮点数格式20171208 hsj
|
||||||
|
9.依照数字话版本,修改常规装置供电臂保护细节20171222
|
||||||
|
10.修改馈线装置,将馈线启动闭锁修改为远方失灵闭锁重合闸20180108
|
||||||
|
11.修改主变后备及主后一体装置,修改母线保护及高压侧速断保护20180111
|
||||||
|
12.修改故障测距电抗距离法测距算法,电抗与故障类型对应20180310
|
||||||
|
13.增加进线自投装置20180316
|
||||||
|
14.数字化故障测距增加两路电压20180528
|
||||||
|
15.修改多合并单元同步机制20180528
|
||||||
|
16.修改变压器及主变后备装置保护元件出口后1ms元件返回,不出故障报告的问题20180605
|
||||||
|
17.优化故障录波、保存适时波形、采样等机制 20180929
|
||||||
|
18.sv接收通过配置的sv路数动态调节一次对多处理sv帧数 hsj 20180929
|
||||||
|
19.按标准修改AT故测装置20190524
|
||||||
|
20.修改对时策略,当保护检测到B码无效向接口要时标,当接口返回时钟源为B码时,保护将时钟源修改为RTC,解决B码无效后,后台无法校时问题。ly 20200512
|
||||||
|
21.修改备自投复归逻辑,当“自投动作后需复归”为退出时,仅进线失压自投能自动复归。ly 20200512
|
||||||
|
22.修改馈线自投复归逻辑,自动动作后25s自动复归。ly 20200512
|
||||||
|
23.修改复归时,产生两次事故状态解除遥信的bug。ly 20200703
|
||||||
|
24.修改通用测控电压2录波bug。lw 20200703
|
||||||
|
25.修改馈线PT断线写定值后遥信可能不复位的情况。ly20200703
|
||||||
|
26.主变测控装置系统定值预留1修改为地回流CT系数,预留2修改为轨回流CT系数。20200713 ly
|
||||||
|
27.修改馈线保护程序,单位互抗值按一次值整定,增加当显示方式为二次时对单位互抗值进行转换 20200805 ly
|
||||||
|
28.修改馈线保护程序,解决进线自投动作后自动复归导致的自动动作灯不能复归的问题。将PT断线元件移至计算模拟量函数中,保护PT断线导致的电压切换的实时性。采样异常导致的PT断线解除,需延时30毫秒报出解除事件及遥信 20200811 ly
|
||||||
|
29.修改主变保护程序,解决YNv及YN11变压器零序电流CT额定值无效问题。 20200814 ly
|
||||||
|
30.修改遥控逻辑,开出信号的回收用独立的逻辑,主变测控增加隔离开关动作时间定值,主变保护差流越限告警用比率差动控制字,解决AT保护、主变保护告警元件处理方式,确保元件退出后告警元件能正常记录解除事件 20200831 ly
|
||||||
|
31.修改主变保护反时限过励磁写定值后只能告警一次的bug,修改谐波闭锁事件记录逻辑,谐波先于故障也能报出告警事件。 20200917 LY
|
||||||
|
32.修改主变保护过励磁判据,当UA无压时,闭锁过励磁保护。20200917 LY
|
||||||
|
33.修改主变保护程序,非电量仅记录报告,不开出跳闸 20201021 L.Y.
|
227
标准版4.0/prot_digital_v30_Core1.c
Normal file
227
标准版4.0/prot_digital_v30_Core1.c
Normal file
@ -0,0 +1,227 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* PROT_digital_v30_Core1.c
|
||||||
|
*****************************************************************************/
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <ccblkfn.h>
|
||||||
|
#include "adi_initialize.h"
|
||||||
|
#include "PROT_digital_v30_Core1.h"
|
||||||
|
#include "sys/drivers.h"
|
||||||
|
//#include "cgu.h"
|
||||||
|
#include "rtdb.h"
|
||||||
|
#include "digit_protect\inc\digit_commonapi.h"
|
||||||
|
#include "adi_osal.h"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Place program arguments in the following string.
|
||||||
|
*/
|
||||||
|
|
||||||
|
extern void timer_interrupt(void);
|
||||||
|
extern void pulseAjustClock(); //秒脉冲中断处理函数
|
||||||
|
extern int progStart(int ErrCode);
|
||||||
|
extern void KaiChuChannelReset(); //开出通道复位
|
||||||
|
extern void maintask(void);
|
||||||
|
extern int spi_flash_init(void);
|
||||||
|
extern void gse_handle( void );
|
||||||
|
extern int goosesmv_init( void );
|
||||||
|
//int inf_shm_printf_write( const char *forms, ... );
|
||||||
|
extern void adi_gpio_init();
|
||||||
|
double sGetMsTime ( void );
|
||||||
|
extern void adi_qpio_wd_set();
|
||||||
|
extern void adi_qpio_wd_clear();
|
||||||
|
extern int driver_can_adi_open_can0( int baudRate );
|
||||||
|
extern int driver_can_adi_handle( void );
|
||||||
|
|
||||||
|
static double restartTime=0;
|
||||||
|
/* 设定过多少毫秒后,重启系统(停止喂狗) **/
|
||||||
|
int set_boottime( int millSecs )
|
||||||
|
{
|
||||||
|
restartTime = sGetMsTime() + millSecs + 10.0;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
static int feed_watch_dog( void )
|
||||||
|
{
|
||||||
|
if( restartTime < 10 || sGetMsTime()<restartTime )
|
||||||
|
{
|
||||||
|
WD_FEED();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
unsigned int *ptr;
|
||||||
|
double kk1,kk2,kk3;
|
||||||
|
/* Initialize managed drivers and/or services */
|
||||||
|
|
||||||
|
adi_initComponents();
|
||||||
|
i = 1;
|
||||||
|
|
||||||
|
//cgu_init();
|
||||||
|
ptr =(unsigned int *)(RTDB_BUFFER_PROTECT_INIT);
|
||||||
|
*ptr = 1;
|
||||||
|
rtdb_init();
|
||||||
|
//printf("%d",i);
|
||||||
|
//printf("time = %d,time1 = %d\n",k,*((int *)(RTDB_BUFFER_INIT_TIME)));
|
||||||
|
SYS_TRACE("protect system init start \n");
|
||||||
|
|
||||||
|
//spiflash初始化
|
||||||
|
spi_flash_init();
|
||||||
|
(*ptr)++;
|
||||||
|
SYS_TRACE("spi_flash_init finished \n");
|
||||||
|
|
||||||
|
adi_gpio_init();
|
||||||
|
|
||||||
|
//int *pddd;
|
||||||
|
//inf_shm_get_addr_printf( &pddd );
|
||||||
|
//SYS_TRACE("addr = %X\n",pddd);
|
||||||
|
//保护初始化
|
||||||
|
progStart(0);
|
||||||
|
|
||||||
|
(*ptr)++;
|
||||||
|
SYS_TRACE("progStart finished \n");
|
||||||
|
|
||||||
|
//goose sv初始化
|
||||||
|
goosesmv_init( );
|
||||||
|
(*ptr)++;
|
||||||
|
|
||||||
|
//打开can
|
||||||
|
|
||||||
|
driver_can_adi_open_can0( 500 );
|
||||||
|
//driver_can_adi_open_can0( 1000 );
|
||||||
|
(*ptr)++;
|
||||||
|
|
||||||
|
//开出通道复位
|
||||||
|
KaiChuChannelReset();
|
||||||
|
(*ptr)++;
|
||||||
|
//打开定时器
|
||||||
|
//gpio初始化(毫秒中断、秒脉冲中断、看门狗)
|
||||||
|
#ifdef MS_INT_EXTERNAL //毫秒中断为外部中断
|
||||||
|
drv_gpio_init(timer_interrupt,pulseAjustClock);
|
||||||
|
#else //毫秒中断采用内部定时器
|
||||||
|
//打开定时器
|
||||||
|
drv_tmr_open(timer_interrupt);
|
||||||
|
//gpio初始化(秒脉冲中断、看门狗)
|
||||||
|
drv_gpio_init(NULL,pulseAjustClock);
|
||||||
|
#endif
|
||||||
|
SYS_TRACE("drv_tmr_open() finished \n");
|
||||||
|
|
||||||
|
ptr =(unsigned int *)(RTDB_BUFFER_PROTECT_INIT);
|
||||||
|
*ptr = SHM_BUFF_INIT_FLAG;
|
||||||
|
|
||||||
|
ptr =(unsigned int *)(RTDB_BUFFER_PROTECT_COUNT);
|
||||||
|
*ptr = 0;
|
||||||
|
//printf("v = %X\n",*(unsigned int *)(RTDB_BUFFER_PROTECT_INIT));
|
||||||
|
|
||||||
|
//为了使网口发送成功第一帧GOOSE,必须如下延迟
|
||||||
|
//sMsSleep(3500);
|
||||||
|
|
||||||
|
//gsemv_goose_check_send();
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
//continue;
|
||||||
|
#ifdef CCES_ADI
|
||||||
|
//execute_as_subscriber();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
//kk1 = sGetMsTime();
|
||||||
|
feed_watch_dog( ); //20180426
|
||||||
|
(*ptr) ++;
|
||||||
|
//can收发
|
||||||
|
driver_can_adi_handle();
|
||||||
|
//WD_FEED();
|
||||||
|
gse_handle();
|
||||||
|
//driver_can_adi_handle();
|
||||||
|
//喂狗
|
||||||
|
//WD_FEED();
|
||||||
|
maintask();
|
||||||
|
|
||||||
|
//adi_gpio_wd_feed();
|
||||||
|
//D_OUT(0, 2);
|
||||||
|
if( *ptr%200000 == 0 )
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
static int subNum=0;
|
||||||
|
|
||||||
|
subNum++;
|
||||||
|
if( subNum > 0 )
|
||||||
|
{
|
||||||
|
int gsv_clnp_recv_submit_buffer( int eth_index );
|
||||||
|
|
||||||
|
|
||||||
|
subNum = gsv_clnp_recv_submit_buffer( 2 );
|
||||||
|
if( 0 != subNum )
|
||||||
|
{
|
||||||
|
inf_shm_printf_write("gsv_clnp_recv_submit_buffer failed.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
subNum = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if 0
|
||||||
|
int gsv_clnp_send( int eth_index, unsigned char *msg, int msg_len );
|
||||||
|
unsigned char buff[128]={00,00,00,00,00,00,11,22,33,44,55,66,0x81,00,00,00,
|
||||||
|
0x88,0xb8,0x30,0x08,0x00,0x37,0x00,0x00,0x00,0x00,0x61,0x2d,0x80,0x01,0x62,0x81,
|
||||||
|
};
|
||||||
|
static unsigned char dd=0,iLoop;
|
||||||
|
|
||||||
|
for( iLoop=48; iLoop<49; iLoop++ )
|
||||||
|
buff[iLoop]=(unsigned char)(iLoop+dd);
|
||||||
|
dd++;
|
||||||
|
|
||||||
|
gsv_clnp_send(3, buff, sizeof(buff) );
|
||||||
|
buff[iLoop]=(unsigned char)(iLoop+dd);
|
||||||
|
gsv_clnp_send(3, buff, sizeof(buff) );
|
||||||
|
//gsv_clnp_send(3, buff, sizeof(buff) );
|
||||||
|
#endif
|
||||||
|
#if 0
|
||||||
|
static unsigned char status=0;
|
||||||
|
|
||||||
|
status = !status;
|
||||||
|
gw61850gse_data_value_change(1,NULL,2041, (void *)&status);
|
||||||
|
gw61850gse_data_value_change(1,NULL,2054, (void *)&status);
|
||||||
|
gw61850gse_check_and_send();
|
||||||
|
#endif
|
||||||
|
#if 0
|
||||||
|
int addr;
|
||||||
|
unsigned char buf[1024]={0x55};
|
||||||
|
addr = 64*1024 * (3 + 2);
|
||||||
|
|
||||||
|
//在spi_flash_write中已经将该快擦除
|
||||||
|
memset(buf, 0x55, 1024 );
|
||||||
|
spi_flash_write(addr, buf, 1024 );
|
||||||
|
#endif
|
||||||
|
#if 0
|
||||||
|
static int tmp=0;
|
||||||
|
tmp++;
|
||||||
|
if( tmp > 4 )
|
||||||
|
{
|
||||||
|
tmp = 0;
|
||||||
|
|
||||||
|
gsv_clnp_linkport_reable_rx(2);
|
||||||
|
SYS_TRACE("\n \t>>Now reset LinkPort.\n" );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
//SYS_TRACE(">>Now protect circle is %d, time is %0.3f.\n",
|
||||||
|
// *ptr/1000, sGetMsTime()/1000 );
|
||||||
|
|
||||||
|
}
|
||||||
|
//kk2 = sGetMsTime();
|
||||||
|
/*
|
||||||
|
if((kk3 = kk2 - kk1)>= 8)
|
||||||
|
{
|
||||||
|
SYS_TRACE("the circle %d time is longer than 8ms and the circle time is %f\n",*ptr,kk3);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
/* Begin adding your custom code here */
|
||||||
|
|
||||||
|
}
|
10
标准版4.0/prot_digital_v30_Core1.h
Normal file
10
标准版4.0/prot_digital_v30_Core1.h
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* prot_digital_v30_Core1.h
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __PROT_DIGITAL_V30_CORE1_H__
|
||||||
|
#define __PROT_DIGITAL_V30_CORE1_H__
|
||||||
|
|
||||||
|
/* Add your custom header content here */
|
||||||
|
|
||||||
|
#endif /* __PROT_DIGITAL_V30_CORE1_H__ */
|
BIN
标准版4.0/prot_digital_v30_Core1.rar
Normal file
BIN
标准版4.0/prot_digital_v30_Core1.rar
Normal file
Binary file not shown.
BIN
标准版4.0/src.rar
Normal file
BIN
标准版4.0/src.rar
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user