commCPU_SUPV/code/link60870/inc/iec104_define.h
2025-04-30 16:24:29 +08:00

165 lines
7.9 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef IEC104_DEFINE_INCLUDED
#define IEC104_DEFINE_INCLUDED
//关于位置偏移地址的定义
#define IEC104_OFFSET_LEN 1
#define IEC104_OFFSET_CODE 2
#define IEC104_OFFSET_TI 6
#define IEC104_OFFSET_VSQ 7
#define IEC104_OFFSET_COT 8
#define IEC104_OFFSET_COMADDR 10 // cpu number
#define IEC104_OFFSET_ADDR 11 // sub address
#define IEC104_OFFSET_INF 12
#define IEC104_OFFSET_CONTEXT 15
#define IEC104_MIN_FRAMELEN 13 // to inf(include it)
//下面几个定义针对客专104协议中定值相关定义
#define IEC104_OFFSET_DZ_ADDR 15
#define IEC104_OFFSET_DZ_INF 17
#define IEC104_OFFSET_DZ_RII 18
#define IEC104_OFFSET_DZ_NGD 19
//下面几个是第一个条的相关信息
#define IEC104_OFFSET_DZ_GIN_GROUP_1 20
#define IEC104_OFFSET_DZ_GIN_ITEM_1 21
#define IEC104_OFFSET_DZ_GIN_GID_1 26
//下面几个是客专104中关于录播文件的定义
#define IEC101_OFFSET_NOS 17 //name of section
#define IEC101_OFFSET_SEGMENT 18
//关于TI类型的定义
/* Process information in monitor direction */
#define IEC104_TI_M_SP_NA_1 1 // single-point information without time tag
#define IEC104_TI_M_SP_TA_1 2 // single-point information with time tag
#define IEC104_TI_M_DP_NA_1 3 // double-point information without time tag
#define IEC104_TI_M_DP_TA_1 4 // double-point information with time tag
#define IEC104_TI_M_ST_NA_1 5 // step position information without time tag
#define IEC104_TI_M_ST_TA_1 6 // step position information with time tag
#define IEC104_TI_M_BO_NA_1 7 // bistring of 32 bits
#define IEC104_TI_M_ME_NA_1 9 // measured value,normalize value
#define IEC104_TI_M_ME_TA_1 10 // measured value with time tag
#define IEC104_TI_M_ME_NB_1 11 // measured value,scaled
#define IEC104_TI_M_ME_NC_1 13 // measured value,short floating point number
#define IEC104_TI_M_IT_NA_1 15 // integrated totals
#define IEC104_TI_M_IT_TA_1 16 // integrated totals with time tag
#define IEC104_TI_M_EP_TA_1 17 // protective or autoclose event report with time tag
#define IEC104_TI_M_PS_NA_1 20 // packed single-point information with status change detection
#define IEC104_TI_M_ME_ND_1 21 // measured value,normalized value without quality descriptor
#define IEC104_TI_M_ME_NE_1 22
#define IEC104_TI_M_SP_TB_1 30 // single-point information with time tag CP56Time2a
#define IEC104_TI_M_DP_TB_1 31 // double-point intormation with time tag CP56Time2a
#define IEC104_TI_M_ST_TB_1 32 // step position information with time tag CP56Time2a
#define IEC104_TI_M_BO_TB_1 33 // bitstring of 32 bit with time tag CP56Time2a
#define IEC104_TI_M_ME_TD_1 34 // measured value,normalized value with time tag CP56Time2a
#define IEC104_TI_M_ME_TE_1 35 // measured value,scaled value with time tag CP56Time2a
#define IEC104_TI_M_ME_TF_1 36 // measured value,short float point number with time tag CP56Time2a
#define IEC104_TI_M_IT_TB_1 37 // integrated totals with tag CP56Time2a
#define IEC104_TI_M_EP_TD_1 38 // event of protection equipment with time tag CP56Time2a
#define IEC104_TI_M_EP_TE_1 39 // packed start events of protection wquipment with time tag CP56Time2a
#define IEC104_TI_M_EP_TF_1 40 // packed output circuit information of protection equipment with time tag CP56Time2a
//<41..44> // reserved for furthure compatible definitions
/* Process information in control direction */
#define IEC104_TI_C_SC_NA_1 45 // single command
#define IEC104_TI_C_DC_NA_1 46 // double command
#define IEC104_TI_C_RC_NA_1 47 // regulating step command
#define IEC104_TI_C_SE_NA_1 48 // set point command,normalized value
#define IEC104_TI_C_SE_NB_1 49 // set point command,scaled value
#define IEC104_TI_C_SE_NC_1 50 // set point command,short floating-point number
#define IEC104_TI_C_BO_NA_1 51 // botstromg of 32 bits
//<52..57> // reserved for further compatible definitions
#define IEC104_TI_C_SC_TA_1 58 // single command with time tag CP56Time2a
#define IEC104_TI_C_DC_TA_1 59 // double command with time tag CP56Time2a
#define IEC104_TI_C_RC_TA_1 60 // regulating step command with time tag CP56Time2a
#define IEC104_TI_C_SE_TA_1 61 // set point command,normalized value with time tag CP56Time2a
#define IEC104_TI_C_SE_TB_1 62 // set point command,scaled value with time tag CPTime2a
#define IEC104_TI_C_SE_TC_1 63 // set point command,short floating-point number with time tag CP56Time2a
#define IEC104_TI_C_BO_TA_1 64 // bitstring of 32 bits with time tag CP56Time2a
//<65..69> // reserved for further compatible definitions
/*System information in monitor direction*/
#define IEC104_TI_M_EI_NA_1 70 // end of initialization
//<71..99> // reserved for further compatible definitions
/*system information in control direction*/
#define IEC104_TI_C_IC_NA_1 100 // interrogation command
#define IEC104_TI_C_CI_NA_1 101 // counter interrogation command
#define IEC104_TI_C_RD_NA_1 102 // read command
#define IEC104_TI_C_CS_NA_1 103 // clock synchronization command
#define IEC104_TI_C_RP_NA_1 105 // reset process command
#define IEC104_TI_C_TS_TA_1 107 // test command with time tag CP56Time2a
//<108..109> // reserved for furter compatible definitions
/* Parameter control direction*/
#define IEC104_TI_P_ME_NA_1 110 // parameter of measured value,normalized value
#define IEC104_TI_P_ME_NB_1 111 // parameter of measured value,scaled value
#define IEC104_TI_P_ME_NC_1 112 // parameter of measured value,short float-point number
#define IEC104_TI_P_AC_NA_1 113 // patameter activation
//<114..119> // reserved for furter compatible definitions
/* file translate*/
#define IEC104_TI_F_FR_NA_1 120 // file ready
#define IEC104_TI_F_SR_NA_1 121 // section ready
#define IEC104_TI_F_SC_NA_1 122 // call directory,select file, call file,call section
#define IEC104_TI_F_LS_NA_1 123 // last section,last segment
#define IEC104_TI_F_AF_AN_1 124 // ack file,ack section
#define IEC104_TI_F_SG_NA_1 125 // segment
#define IEC104_TI_F_DR_TA_1 126 // directory
/******ti extend ,begin with xj****/
#define JDXJ104_TI_E_SJ_TA_1 141 // SJ, ZJ report extern
#define JDXJ104_TI_E_DZ_NA_1 145 // DZ about
#define JDXJ104_TI_E_VER_NA_1 149 //soft version
#define JDXJ104_TI_E_SJ_NA_1 150 //sjzj origion
#define JDXJ104_TI_E_SJ_NC_1 151 //sjzj call
#define JDXJ104_TI_E_GZ_NA_1 152 // gzbg origion
#define JDXJ104_TI_E_AT_NA_1 230 // atgc origion
//关于传输原因的定义
#define IEC104_COT_M_PN 0x40
#define IEC104_COT_M_cyc 1
#define IEC104_COT_M_scan 2
#define IEC104_COT_M_spont 3
#define IEC104_COT_M_init 4
#define IEC104_COT_M_req 5
#define IEC104_COT_M_act 6
#define IEC104_COT_M_acton 7
#define IEC104_COT_M_deact 8
#define IEC104_COT_M_deactcon 9
#define IEC104_COT_M_actterm 10
#define IEC104_COT_M_retrem 11
#define IEC104_COT_M_retloc 12
#define IEC104_COT_M_file 13
//14 _ 19
#define IEC104_COT_M_introgen 20
#define IEC104_COT_M_intro1 21
#define IEC104_COT_M_intro2 22
#define IEC104_COT_M_intro3 23
#define IEC104_COT_M_intro4 24
//及数量召唤
#define IEC104_COT_M_reqcogen 37
#define IEC104_COT_M_reqco1 38
#define IEC104_COT_M_reqco2 39
#define IEC104_COT_M_reqco3 40
#define IEC104_COT_M_reqco4 41
//错误的传输原因
#define IEC104_COT_M_PN_TI (IEC104_COT_M_PN+44)
#define IEC104_COT_M_PN_COT (IEC104_COT_M_PN+45)
#define IEC104_COT_M_PN_ADDR (IEC104_COT_M_PN+46)
#define IEC104_COT_M_PN_INF (IEC104_COT_M_PN+47)
#define IEC104_COT_M_PN_USER1 (IEC104_COT_M_PN+48)
#define IEC104_COT_M_PN_USER2 (IEC104_COT_M_PN+49)
#endif