遥信防抖动设计方案.docVIP

  • 198
  • 0
  • 约1.52万字
  • 约 13页
  • 2017-10-06 发布于重庆
  • 举报
遥信防抖动设计方案

遥信防抖动设计 遥信检测注意事项: 1:遥信检测必须对位变量检测,当遥信数目较多时,应采用单点顺序检测并各个遥信独立建立计时计数器计时; 2:为有效防抖,遥信分辨率时间,也就是遥测循环检测终端时间不可大于遥信防抖动时间。 典型错误案例1:不是对单个位变量检测 //遥信检测建立标志位+电池检测 void check_yx ( void ) { if ( switchin1.all != ( *KRReg ) ) { if ( switchin_flag == 0 ) { switchin_flag = 1; switchin_time = 0; KRBIT.all = ( *KRReg ); } } else { switchin_flag = 0; switchin_time = 0; } } //遥信记录处理+电池检测 void save_yx ( void ) { uint16 i; if ( switchin_flag == 1 ) { if ( ( switchin_time * 1 ) = TerPara.yx_filter_time ) { //switchin1.all=KRBIT.all; // KRBIT.all = yx_chang(switchin1.all); if ( switchin1.bit.KR1 != KRBIT.bit.KR1 || switchin1.bit.KR2 != KRBIT.bit.KR2 ) { if ( switchin1.bit.KR1 != KRBIT.bit.KR1 ) { switchin.bit.KR1 = ~switchin.bit.KR1; SoeBuffer.SoeData[SoeBuffer.SoeCnt].status = switchin.bit.KR1; produce_soe_event ( NULL, 1, DISP_Z , POP_EVENT_SOE ); } if ( switchin1.bit.KR2 != KRBIT.bit.KR2 ) { switchin.bit.KR2 = ~switchin.bit.KR2; SoeBuffer.SoeData[SoeBuffer.SoeCnt].status = switchin.bit.KR2; produce_soe_event ( NULL, 2, DISP_Z , POP_EVENT_SOE ); } if ( switchin.bit.KR1 == 1 switchin.bit.KR2 == 0 ) {//断路器1合 produce_soe_event ( NULL, 0x002C, DISP_TIME , POP_EVENT_SOE ); } else if ( switchin.bit.KR1 == 0 switchin.bit.KR2 == 1 ) {//断路器1分 produce_soe_event ( NULL, 0x002D, DISP_TIME , POP_EVENT_SOE ); } else {//断路器1位置异常 produce_soe_event ( NULL, 0x002E, DISP_TIME , POP_EVENT_SOE ); } } if ( switchin1.bit.KR3 != KRBIT.bit.KR3 ) { switchin.bit.KR3 = ~switchin.bit.KR3; SoeBuffer.SoeData[SoeBuffer.So

文档评论(0)

1亿VIP精品文档

相关文档