From 6dae38f8a5a4688d8ab6de6cfc46f7bda8808bbb Mon Sep 17 00:00:00 2001 From: RobertJDavis Date: Mon, 8 Dec 2025 18:23:06 -0600 Subject: [PATCH] WIP common alarm --- .../StateUtils.cpp | 23 +++++++++++++++---- .../PHX3_CRAH_LIEBERT_80_SLAB_TCP/config.h | 20 ++++++++-------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/BMS/CRAH/PHX3_CRAH_LIEBERT_80_SLAB_TCP/StateUtils.cpp b/src/BMS/CRAH/PHX3_CRAH_LIEBERT_80_SLAB_TCP/StateUtils.cpp index cad0898..fa0e4ff 100644 --- a/src/BMS/CRAH/PHX3_CRAH_LIEBERT_80_SLAB_TCP/StateUtils.cpp +++ b/src/BMS/CRAH/PHX3_CRAH_LIEBERT_80_SLAB_TCP/StateUtils.cpp @@ -44,6 +44,7 @@ void updateReturnAirTempAlarms(Equipment* equipment){ equipment->setModbus_Point("RATempLowAlm Value", RATempLowAlm); if (returnAirTemp->getValue() < returnTempLowAlarmSP->getValue()) { + equipment->setModbus_Point("Alarm High Return Air Temp", 1); equipment->setModbus_Point("Alarm High Return Air Temp", 1); //returnTempHighAlarm->setValue(1); } @@ -95,15 +96,15 @@ void updateReturnHumidityAlarms(Equipment* equipment){ int RAHumHighAlm = returnHumHighAlarmSP->getValue(); int RAHumLowAlm = returnHumLowAlarmSP->getValue(); - equipment->setModbus_Point("RATemp Value", RAHum); - equipment->setModbus_Point("RATempHighAlm Value", RAHumHighAlm); - equipment->setModbus_Point("RATempLowAlm Value", RAHumLowAlm); + equipment->setModbus_Point("RAHum Value", RAHum); + equipment->setModbus_Point("RAHumHighAlm Value", RAHumHighAlm); + equipment->setModbus_Point("RAHumLowAlm Value", RAHumLowAlm); if (returnHumidity->getValue() > returnHumHighAlarmSP->getValue()) { equipment->setModbus_Point("Alarm High Return Humidity", 1); } else if (returnHumidity->getValue() < returnHumLowAlarmSP->getValue()) { - equipment->setModbus_Point("AAlarm Low Return Humidity", 1); + equipment->setModbus_Point("Alarm Low Return Humidity", 1); } else{ equipment->setModbus_Point("Alarm High Return Humidity", 0); @@ -146,8 +147,14 @@ void updateAlarms(Equipment* equipment){ "Common Alarm ON", "Alarm Pump Failure ON", "Alarm Comm Loss Condenser 1 ON", "Alarm Comm Loss Condenser 2 ON", "Alarm Compressor 1B Overload ON", "Alarm Compressor 2B Overload ON" }; + + const std::vector alarmAnalogs = { + "Alarm High Return Air Temp", "Alarm Low Return Air Temp", "Alarm High Return Humidity", "Alarm Low Return Humidity", + "Alarm High Supply Temp", "Alarm Low Supply Temp" + }; + // If any Alarm Commands = 1, set the appropriate Alarm = 1 and increment counter for number of active alarms int numAlarms = 0; for (int i =0; i< alarmCommands.size() && i < alarmDescriptions.size(); ++i) { Modbus_Point* commandPoint = equipment->getModbus_Point(alarmCommands[i]); @@ -157,6 +164,14 @@ void updateAlarms(Equipment* equipment){ if (alarmPoint->getValue() == 1) numAlarms++; } } + // If any of the analog alarms = 1, increment counter for number of active alarms + for (int j = 0; j* alarmAnalogPoint = equipment->getModbus_Point(alarmAnalogs[j]); + if (alarmAnalogPoint) { + if (alarmAnalogPoint->getValue() == 1) numAlarms++; + } + } + // If any alarms are active, set the Common Alarm = 1, else Common Alarm = 0. if (numAlarms >= 1) equipment->setModbus_Point("Common Alarm", 1); else equipment->setModbus_Point("Common Alarm", 0); } diff --git a/src/BMS/CRAH/PHX3_CRAH_LIEBERT_80_SLAB_TCP/config.h b/src/BMS/CRAH/PHX3_CRAH_LIEBERT_80_SLAB_TCP/config.h index 5e96ab1..e9e6797 100644 --- a/src/BMS/CRAH/PHX3_CRAH_LIEBERT_80_SLAB_TCP/config.h +++ b/src/BMS/CRAH/PHX3_CRAH_LIEBERT_80_SLAB_TCP/config.h @@ -21,10 +21,10 @@ * @{ */ #include - const char *ssid = "TP-Link_D91A"; /**< @brief The SSID of the WiFi network. */ - const char *password = "52761492"; /**< @brief The password for the WiFi network. */ - IPAddress local_IP(192, 168, 0, 234); /**< @brief The static IP address for the device. */ - IPAddress gateway(192, 168, 1, 1); /**< @brief The gateway IP address. */ + const char *ssid = "ArduinoWifiB"; /**< @brief The SSID of the WiFi network. */ + const char *password = "123abc456"; /**< @brief The password for the WiFi network. */ + IPAddress local_IP(172, 17, 32, 11); /**< @brief The static IP address for the device. */ + IPAddress gateway(172, 17, 32, 1); /**< @brief The gateway IP address. */ IPAddress subnet(255, 255, 255, 0); /**< @brief The subnet mask. */ ModbusIP mb; @@ -159,17 +159,17 @@ modbusMap mb_map[] = {HR_10x, 738, 0, "Return Air Temp Alarm High SP"}, {HR_10x, 739, 0, "Return Air Temp Alarm Low SP"}, - {HR, 740, 0, "RATemp Value"}, - {HR, 741, 0, "RATempHighAlm Value"}, - {HR, 742, 0, "RATempLowAlm Value"}, + {HR, 741, 0, "RATemp Value"}, + {HR, 742, 0, "RATempHighAlm Value"}, + {HR, 743, 0, "RATempLowAlm Value"}, {HR, 753, 80, "Return Air Temp Setpoint"}, {HR_10x, 754, 78, "Supply Air Temp Alarm High SP"}, {HR_10x, 755, 72, "Supply Air Temp Alarm Low SP"}, - {HR, 740, 0, "SATemp Value"}, - {HR, 741, 0, "SATempHighAlm Value"}, - {HR, 742, 0, "SATempLowAlm Value"}, + {HR, 757, 0, "SATemp Value"}, + {HR, 758, 0, "SATempHighAlm Value"}, + {HR, 759, 0, "SATempLowAlm Value"}, };