UMAS CRAH update

Changed running status to 0: running, 1: stopped per UMAS submittal
Made default value of BMS Enable = 2 (BMS), so do not have to change to run
Fixed bug associated with Fail State update() --> Standby Mode
This commit is contained in:
RobertJDavis
2025-10-21 13:14:49 -07:00
parent cd62dd15f3
commit 07bf9036dc
6 changed files with 34 additions and 27 deletions

View File

@@ -12,7 +12,7 @@
default_envs = CRAH_UMAS_TCP ; Select here the name of the configuration you want to download
[env]
upload_port = COM5
upload_port = COM9
[common_env_options]
framework = arduino

View File

@@ -75,6 +75,8 @@ void updateAlarms(Equipment<ModbusIP>* equipment){
"Alarm Condensate Pump ON", "Alarm Fire ON", "Alarm Smoke ON"
};
// NOTE: Per UMAS hardwire signals, alarm opened in case of normal operation, closed in case of alarm condition
// 0: no alarm, 1: alarm
int numAlarms = 0;
for (int i =0; i< alarmCommands.size() && i < alarmDescriptions.size(); ++i) {
Modbus_Point<ModbusIP>* commandPoint = equipment->getModbus_Point(alarmCommands[i]);

View File

@@ -82,8 +82,8 @@ State<ModbusIP>* FailState<ModbusIP>::update(Equipment<ModbusIP>* equipment) {
setPointValue(equipment, "ON/OFF Command By BMS", 0);
// The only way to exit the Fail State is for Leak Detect Alarm to turn off, then enter Standby State.
bool leakDetected = equipment->getModbus_Point("Alarm Leak Detect");
if (leakDetected == 0){
bool leakDetected = getPointValue(equipment, "Alarm Leak Detect");
if (!leakDetected){
return new StandbyState<ModbusIP>();
}
@@ -93,7 +93,7 @@ State<ModbusIP>* FailState<ModbusIP>::update(Equipment<ModbusIP>* equipment) {
/**
* @brief Logic to execute once when entering the fail state.
* When entering failed state, turn all fans off (fan status --> 0) and set BMS Command --> 0
* When entering failed state, turn all fans off (fan status --> 1) and set BMS Command --> 0
* @param equipment Pointer to the Equipment instance.
*/
template<>
@@ -107,11 +107,12 @@ void FailState<ModbusIP>::enterState(Equipment<ModbusIP>* equipment) {
"Run Status Fan 7", "Run Status Fan 8", "Run Status Fan 9"
};
// Loop through and set all motor statuses to 0
// Per UMAS submittal Hardwired Run Status signals- 0: fans running, 1: fans stopped
// Loop through and set all motor statuses to 1
for (const auto& desc : motorStatusDescriptions) {
Modbus_Point<ModbusIP>* point = equipment->getModbus_Point(desc);
if (point) {
point->setValue(0);
point->setValue(1);
}
};

View File

@@ -114,7 +114,7 @@ State<ModbusIP>* RunningState<ModbusIP>::update(Equipment<ModbusIP>* equipment)
// Check to see if BMS Command set to OFF --> Place unit in Standby
// Removed logic of placing unit on standby if BMS_Enable_Source != 2 for ease in testing Mode Feedback.
if (On_Off_Command == 0){
setPointValue(equipment, "ON/OFF Command By BMS", 0);
// setPointValue(equipment, "ON/OFF Command By BMS", 0);
return new StandbyState<ModbusIP>();
}
@@ -164,18 +164,19 @@ void RunningState<ModbusIP>::enterState(Equipment<ModbusIP>* equipment) {
"Run Status Fan 7", "Run Status Fan 8", "Run Status Fan 9"
};
// Loop through and set all motor statuses to 1
// Per UMAS submittal Hardwired Run Status signals- 0: fans running, 1: fans stopped
// Loop through and set all motor statuses to 0
for (const auto& desc : motorStatusDescriptions) {
Modbus_Point<ModbusIP>* point = equipment->getModbus_Point(desc);
if (point) {
point->setValue(1);
point->setValue(0);
}
}
}
/**
* @brief Logic to execute once when exiting the running state.
* Sets the "Run Status" for all EC fans to 0 before transitioning to the next state.
* Sets the "Run Status" for all EC fans to 1 (stopped) before transitioning to the next state.
* @param equipment Pointer to the Equipment instance.
*/
template<>
@@ -188,11 +189,12 @@ void RunningState<ModbusIP>::exitState(Equipment<ModbusIP>* equipment) {
"Run Status Fan 7", "Run Status Fan 8", "Run Status Fan 9"
};
// Loop through and set all motor statuses to 0
// Per UMAS submittal Hardwired Run Status signals- 0: fans running, 1: fans stopped
// Loop through and set all motor statuses to 1
for (const auto& desc : motorStatusDescriptions) {
Modbus_Point<ModbusIP>* point = equipment->getModbus_Point(desc);
if (point) {
point->setValue(0);
point->setValue(1);
}
}
}

View File

@@ -105,7 +105,7 @@ State<ModbusIP>* StandbyState<ModbusIP>::update(Equipment<ModbusIP>* equipment)
/**
* @brief Logic to execute once when entering the standby state.
* This method performs cleanup by setting all EC fan run status points to 0.
* This method performs cleanup by setting all EC fan run status points to 1 (stopped).
* The BMS Command is also set to OFF.
* @param equipment Pointer to the Equipment instance.
*/
@@ -120,11 +120,12 @@ void StandbyState<ModbusIP>::enterState(Equipment<ModbusIP>* equipment) {
"Run Status Fan 7", "Run Status Fan 8", "Run Status Fan 9"
};
// Loop through and set all motor statuses to 0
// Per UMAS submittal Hardwired Run Status signals- 0: fans running, 1: fans stopped
// Loop through and set all motor statuses to 1
for (const auto& desc : motorStatusDescriptions) {
Modbus_Point<ModbusIP>* point = equipment->getModbus_Point(desc);
if (point) {
point->setValue(0);
point->setValue(1);
}
};

View File

@@ -99,15 +99,15 @@ modbusMap mb_map[] =
{IR, 50, 0, "Alarm Fan 7"},
{IR, 54, 0, "Alarm Fan 8"},
{IR, 58, 0, "Alarm Fan 9"},
{IR, 27, 0, "Run Status Fan 1"}, // Send to PLC
{IR, 31, 0, "Run Status Fan 2"}, // Send to PLC
{IR, 35, 0, "Run Status Fan 3"}, // Send to PLC
{IR, 39, 0, "Run Status Fan 4"}, // Send to PLC
{IR, 43, 0, "Run Status Fan 5"}, // Send to PLC
{IR, 47, 0, "Run Status Fan 6"}, // Send to PLC
{IR, 51, 0, "Run Status Fan 7"}, // Send to PLC
{IR, 55, 0, "Run Status Fan 8"}, // Send to PLC
{IR, 59, 0, "Run Status Fan 9"}, // Send to PLC
{IR, 27, 1, "Run Status Fan 1"}, // Send to PLC
{IR, 31, 1, "Run Status Fan 2"}, // Send to PLC
{IR, 35, 1, "Run Status Fan 3"}, // Send to PLC
{IR, 39, 1, "Run Status Fan 4"}, // Send to PLC
{IR, 43, 1, "Run Status Fan 5"}, // Send to PLC
{IR, 47, 1, "Run Status Fan 6"}, // Send to PLC
{IR, 51, 1, "Run Status Fan 7"}, // Send to PLC
{IR, 55, 1, "Run Status Fan 8"}, // Send to PLC
{IR, 59, 1, "Run Status Fan 9"}, // Send to PLC
{IR, 25, 0, "Speed Fan 1"},
{IR, 29, 0, "Speed Fan 2"},
{IR, 33, 0, "Speed Fan 3"},
@@ -126,7 +126,7 @@ modbusMap mb_map[] =
{IR, 52, 0, "Operating Hours Fan 7"},
{IR, 56, 0, "Operating Hours Fan 8"},
{IR, 60, 0, "Operating Hours Fan 9"},
{IR, 61, 0, "Control Mode Selected"},
{IR, 61, 0, "Control Mode Selected"}, // 0: BMS+Speed, 1: BMS+Room Temp, 2: Return Temp
{IR_FLOAT, 63, 0, "Amps Fan 1"},
{IR_FLOAT, 65, 0, "Amps Fan 2"},
{IR_FLOAT, 67, 0, "Amps Fan 3"},
@@ -141,8 +141,9 @@ modbusMap mb_map[] =
{HR_FLOAT, 17, 0, "Supply Air Temp Setpoint"}, // Receive signal from PLC
{HR_FLOAT, 21, 0, "Fan Min Speed"}, // Send to PLC
{HR_FLOAT, 23, 0, "Fan Max Speed"}, // Send to PLC
{HR, 25, 0, "BMS Control Source"}, // Receive signal from PLC
{HR, 26, 0, "BMS Enable Source"}, // Receive signal from PLC
{HR, 25, 0, "BMS Control Source"}, // Receive signal from PLC 0:Speed, 1:Room Temp
{HR, 26, 2, "BMS Enable Source"}, // Receive signal from PLC 0:Keypad, 1:DI, 2:BMS
{HR, 99, 0, "CRAH Heartbeat"} // Placeholder - we don't have this from UMAS yet. Not used in logic yet.
};
//Size of modbus map used in FOR cycles, automatically calculated.