优化DIDO策略有上位机匹配

This commit is contained in:
ahu_gq 2025-02-07 17:30:47 +08:00
parent b21c5fadd4
commit bcb31a7c5a
3 changed files with 63 additions and 5 deletions

View File

@ -31,6 +31,8 @@ typedef enum
kDoCtrlStatus_End, kDoCtrlStatus_End,
}DoCtrlStatus; }DoCtrlStatus;
/*0-无1-预充2-总正3-总负4-充电5-放电6-加热7-制冷8-运行灯19-运行灯210-运行灯3
11-112-213-314-115-216-317-4*/
typedef enum typedef enum
{ {
kDoType_Start = 0, kDoType_Start = 0,
@ -40,6 +42,18 @@ typedef enum
kDoType_PreChg, //3 kDoType_PreChg, //3
kDoType_Positive, //4 kDoType_Positive, //4
kDoType_Negative,//5 kDoType_Negative,//5
kDoType_Cool,
kDoType_Heat,
kDoType_RunLed1,
kDoType_RunLed2,
kDoType_RunLed3,
kDoType_AlarmLed1,
kDoType_AlarmLed2,
kDoType_AlarmLed3,
kDoType_Trip1,
kDoType_Trip2,
kDoType_Trip3,
kDoType_Trip4,
kDoType_End, kDoType_End,
}DoType; }DoType;
@ -79,6 +93,15 @@ typedef enum
kDiType_Do6Feedback, kDiType_Do6Feedback,
kDiType_Do7Feedback, kDiType_Do7Feedback,
kDiType_Do8Feedback, kDiType_Do8Feedback,
kDiType_Door,//门禁
kDiType_Water,//水浸
kDiType_Fuse,//保险丝故障信号
kDiType_Pcs,//PCS故障信号
kDiType_AirCon,//空调故障信号
kDiType_Trip,//隔离开关反馈信号
kDiType_AirCheck,//气体检测故障信号
kDiType_Ups,//UPS故障信号
kDiType_Ems,//EMS故障信号
kDiType_End kDiType_End
}DiType; }DiType;

View File

@ -17,7 +17,24 @@ const DoLogic bmsCircuitCtrl[kDoCtrlStrategy_End] =
const DoLogic doLogicArray[kDoType_End] = { const DoLogic doLogicArray[kDoType_End] = {
NULL, NULL, NULL, NULL, NULL, NULL NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
logic_do_cool1_ctrl,
logic_do_heat1_ctrl,
logic_do_run1_led_ctrl,
logic_do_run1_led_ctrl,
logic_do_run1_led_ctrl,
logic_do_alarm1_led_ctrl,
logic_do_alarm1_led_ctrl,
logic_do_alarm1_led_ctrl,
logic_do_trip1_ctrl,
logic_do_trip1_ctrl,
logic_do_trip1_ctrl,
logic_do_trip1_ctrl //17
}; };

View File

@ -98,13 +98,31 @@ void ord_di_breaker1_fun(uint32_t base_time, DiStatus di_signal, DiType di)
} }
} }
/*无消防1消防2消防3DO1反馈信号DO2反馈信号DO3反馈信号DO4反馈信号DO5反馈信号
DO6反馈信号PCS故障信号
UPS故障信号EMS故障信号*/
//DI策略对应函数注意应与枚举DiStrategy顺序一致 //DI策略对应函数注意应与枚举DiStrategy顺序一致
const DiFun di_func[kDiType_End]= { const DiFun di_func[kDiType_End]= {
NULL, NULL,
NULL, ord_di_emerge_stop_func, //急停,
NULL, ord_di_fire_alarm1_func,//消防1
NULL, ord_di_fire_alarm1_func,//消防2
ord_di_fire_alarm1_func,//消防3
ord_di_do_feedback_func,//DO1反馈信号
ord_di_do_feedback_func,//DO2反馈信号
ord_di_do_feedback_func,//DO3反馈信号
ord_di_do_feedback_func,//DO4反馈信号
ord_di_do_feedback_func,//DO5反馈信号
ord_di_do_feedback_func,//DO6反馈信号
NULL,//门禁
ord_di_water1_fun,//水浸
ord_di_fuse1_fun,//保险丝故障信号
NULL,//PCS故障信号
NULL,//空调故障信号
NULL,//隔离开关反馈信号
NULL,//气体检测故障信号
NULL,//UPS故障信号
NULL//EMS故障信号
}; };