Index: firmware/App/Modes/ModeHeatDisinfect.c =================================================================== diff -u -r28b5f2e7f757647145a82a39aca0a5f3652c68a1 -r99b0c8f1ff9f9319f68e5043cd8c007e317a05c0 --- firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision 28b5f2e7f757647145a82a39aca0a5f3652c68a1) +++ firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision 99b0c8f1ff9f9319f68e5043cd8c007e317a05c0) @@ -19,6 +19,7 @@ #include "DrainPump.h" #include "Heaters.h" #include "LoadCell.h" +#include "ModeFault.h" #include "ModeHeatDisinfect.h" #include "OperationModes.h" #include "Pressures.h" @@ -138,7 +139,7 @@ static U32 dataPublishCounter = 0; ///< Heat Disinfect data publish counter. static CANCELLATION_MODES_T cancellationMode = CANCELLATION_MODE_NONE; ///< Cancellation mode. static U32 rsrvrFillStableTimeCounter = 0; ///< Reservoirs fill stable time counter. -static ALARM_ID_T alarm; ///< Heat disinfect alarm to raise. +static ALARM_ID_T alarmDetectedPendingTrigger; ///< Heat disinfect alarm to raise. static BOOL isDrainPumpInMixDrainOn = FALSE; ///< Flag to show the drain pump is on during mix drain. // ********** private function prototypes ********** @@ -167,7 +168,6 @@ static DG_HEAT_DISINFECT_STATE_T handleHeatDisinfectCancelModeWaterPathState( void ); static DG_HEAT_DISINFECT_STATE_T handleHeatDisinfectCompleteState( void ); -static void resetActuators( void ); static void failHeatDisinfect( void ); static DG_RESERVOIR_STATUS_T getRsrvrFillStatus( DG_RESERVOIR_ID_T r, F32 targetVol, U32 timeout ); static DG_RESERVOIR_STATUS_T getRsrvrDrainStatus( DG_RESERVOIR_ID_T r, U32 drainSteadyStateTimeout, U32 timeout ); @@ -215,7 +215,7 @@ *************************************************************************/ void transitionToHeatDisinfectMode( void ) { - resetActuators(); + deenergizeActuators(); initHeatDisinfectMode(); } @@ -363,7 +363,7 @@ if ( DG_MODE_HEAT == getCurrentOperationMode() ) { // Reset all the actuators - resetActuators(); + deenergizeActuators(); // Transition to mode standby requestNewOperationMode( DG_MODE_STAN ); @@ -397,7 +397,7 @@ overallHeatDisinfectTimer = getMSTimerCount(); // Set all the actuators to reset and de-energized state - resetActuators(); + deenergizeActuators(); // Reset the load cells lowest weight prior to starting the run resetReservoirsLowestWeight(); @@ -411,7 +411,7 @@ if ( ( ppiPressure < MIN_INLET_PRESSURE_PSI ) && ( fabs( TDiTemp - TRoTemp ) > MAX_START_STATE_TEMP_SENSORS_DIFF_C ) ) { prevHeatDisinfectState = state; - alarm = ALARM_ID_DG_HEAT_DISINFECT_INLET_PRES_AND_TEMP_SNSRS_OUT; + alarmDetectedPendingTrigger = ALARM_ID_DG_HEAT_DISINFECT_INLET_PRES_AND_TEMP_SNSRS_OUT; state = DG_HEAT_DISINFECT_STATE_CANCEL_BASIC_PATH; } else @@ -420,8 +420,13 @@ setValveState( VPI, VALVE_STATE_CLOSED ); // Request a tare for reservoir 1 tareReservoir(); +#ifndef V_2_SYSTEM // Set the actuators to drain R1 + setValveState( VRD1, VALVE_STATE_OPEN ); +#else + // Set the actuators to drain R1 setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); +#endif setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); rsrvrFillStableTimeCounter = 0; @@ -460,7 +465,12 @@ // Set the valves to flush the recirculation line setValveState( VPI, VALVE_STATE_OPEN ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); + setValveState( VRD1, VALVE_STATE_CLOSED ); +#else setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); +#endif setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); @@ -480,9 +490,17 @@ rsrvr2Status = DG_RESERVOIR_ABOVE_TARGET; // Request a tare for reservoir 2 tareReservoir(); +#ifndef V_2_SYSTEM + // Done with draining R1, close it + setValveState( VRD1, VALVE_STATE_CLOSED ); // Set the actuators to drain R2. // NOTE: Drain pump is already on and VDr is already on drain state + setValveState( VRD2, VALVE_STATE_OPEN ); +#else + // Set the actuators to drain R2. + // NOTE: Drain pump is already on and VDr is already on drain state setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); +#endif state = DG_HEAT_DISINFECT_STATE_DRAIN_R2; } @@ -521,13 +539,22 @@ { if ( TRUE == isThisLastDrain ) { +#ifndef V_2_SYSTEM + setValveState( VRD1, VALVE_STATE_OPEN ); + setValveState( VRD2, VALVE_STATE_CLOSED ); +#else setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); +#endif rsrvr1Status = DG_RESERVOIR_ABOVE_TARGET; state = DG_HEAT_DISINFECT_STATE_DRAIN_R1; } else { signalDrainPumpHardStop(); +#ifndef V_2_SYSTEM + // Done with draining R2, close it + setValveState( VRD2, VALVE_STATE_CLOSED ); +#endif setValveState( VPI, VALVE_STATE_OPEN ); stateTrialCounter = 0; stateTimer = getMSTimerCount(); @@ -567,7 +594,11 @@ if ( ( getTemperatureValue( TEMPSENSORS_INLET_PRIMARY_HEATER ) > MIN_INLET_TEMPERATURE_C ) && ( getConductivityValue( CONDUCTIVITYSENSORS_CPI_SENSOR ) <= MAX_INLET_CONDUCTIVITY_US_PER_CM ) ) { +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); +#else setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); +#endif setROPumpTargetFlowRate( RO_PUMP_TARGET_FLUSH_FILL_FLOW_RATE_LPM, MAX_RO_PUMP_FLUSH_FILL_PRESSURE_PSI ); stateTimer = getMSTimerCount(); stateTrialCounter = 0; @@ -582,7 +613,7 @@ // Couldn't get a good water sample after a couple of trials and the disinfect cycle failed else { - alarm = ALARM_ID_DG_HEAT_DISINFECT_INLET_COND_AND_TEMP_OUT; + alarmDetectedPendingTrigger = ALARM_ID_DG_HEAT_DISINFECT_INLET_COND_AND_TEMP_OUT; prevHeatDisinfectState = state; state = DG_HEAT_DISINFECT_STATE_CANCEL_BASIC_PATH; } @@ -635,7 +666,7 @@ // State failed. Cancel heat disinfect mode else { - alarm = ALARM_ID_DG_TEMP_SENSORS_DIFF_OUT_OF_RANGE; + alarmDetectedPendingTrigger = ALARM_ID_DG_TEMP_SENSORS_DIFF_OUT_OF_RANGE; prevHeatDisinfectState = state; state = DG_HEAT_DISINFECT_STATE_CANCEL_BASIC_PATH; } @@ -689,6 +720,18 @@ if ( DG_RESERVOIR_BELOW_TARGET == rsrvr1Status ) { rsrvr1Status = getRsrvrFillStatus( DG_RESERVOIR_1, RSRVRS_FULL_VOL_ML, RSRVRS_FILL_UP_TIMEOUT_MS ); + + // Keep monitoring the status of reservoir 2 as the same time + rsrvr2Status = getRsrvrFillStatus( DG_RESERVOIR_2, RSRVRS_PARTIAL_FILL_VOL_ML, RSRVRS_500ML_FILL_UP_TIMEOUT_MS ); + // Reservoir 2 cannot be filled before reservoir 1 is filled and is overflowing to reservoir 2. If reservoir 2 has already + // reached to target volume, it means reservoir 1's load cell might be reading incorrect values. This situation might continue + // until reservoir 2 is filled up and the tubing might expand or leak. + if ( DG_RESERVOIR_REACHED_TARGET == rsrvr2Status ) + { + prevHeatDisinfectState = state; + alarmDetectedPendingTrigger = ALARM_ID_DG_INVALID_LOAD_CELL_VALUE; + state = DG_HEAT_DISINFECT_STATE_CANCEL_WATER_PATH; + } } // Once R1 is full, keep monitoring for R2 level and timeout else if( DG_RESERVOIR_REACHED_TARGET == rsrvr1Status ) @@ -702,7 +745,11 @@ setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); setValveState( VRO, VALVE_STATE_R2_C_TO_NC ); +#ifndef V_2_SYSTEM + setValveState( VRD1, VALVE_STATE_OPEN ); +#else setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); +#endif setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); stateTimer = getMSTimerCount(); @@ -752,6 +799,10 @@ { // Done with draining R1 signalDrainPumpHardStop(); +#ifndef V_2_SYSTEM + // Close VRD1 + setValveState( VRD1, VALVE_STATE_CLOSED ); +#endif } else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr1Status ) { @@ -763,6 +814,21 @@ if ( DG_RESERVOIR_BELOW_TARGET == rsrvr2Status ) { rsrvr2Status = getRsrvrFillStatus( DG_RESERVOIR_2, RSRVRS_FULL_VOL_ML, RSRVRS_FILL_UP_TIMEOUT_MS ); + + U32 drainPumpRPM = getTargetDrainPumpRPM(); + // Keep monitoring the status of reservoir 1 as the same time + F32 volume = getLoadCellSmallFilteredWeight( LOAD_CELL_RESERVOIR_1_PRIMARY ); + // Reservoir 1 cannot be filled before reservoir 2 is filled and is overflowing to reservoir 1. If reservoir 1 has already + // reached to target volume, it means reservoir 2's load cell might be reading incorrect values. This situation might continue + // until reservoir 1 is filled up and the tubing might expand or leak. + // Before checking whether reservoir 1 is filled pre-maturely, we have to make sure reservoir 1 is drained completely to make + // sure the extra volume that is read is not because of previous water that is being drained currently and it is above 500 mL + if ( ( volume > RSRVRS_PARTIAL_FILL_VOL_ML ) && ( 0 == drainPumpRPM ) ) + { + prevHeatDisinfectState = state; + alarmDetectedPendingTrigger = ALARM_ID_DG_INVALID_LOAD_CELL_VALUE; + state = DG_HEAT_DISINFECT_STATE_CANCEL_WATER_PATH; + } } // Once R2 is full, R1 must be partially full else if( DG_RESERVOIR_REACHED_TARGET == rsrvr2Status ) @@ -777,10 +843,18 @@ // Set the valves to drain R2 and no fill setValveState( VPI, VALVE_STATE_CLOSED ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); +#else setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); +#endif setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); +#ifndef V_2_SYSTEM + setValveState( VRD2, VALVE_STATE_OPEN ); +#else setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); +#endif setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); // Start the timer for drain timeout stateTimer = getMSTimerCount(); @@ -824,7 +898,12 @@ } else if ( DG_RESERVOIR_REACHED_TARGET == rsrvr2Status ) { +#ifndef V_2_SYSTEM + setValveState( VRD1, VALVE_STATE_OPEN ); + setValveState( VRD2, VALVE_STATE_CLOSED ); +#else setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); +#endif // Start the timer for drain timeout stateTimer = getMSTimerCount(); rsrvr1Status = DG_RESERVOIR_ABOVE_TARGET; @@ -866,12 +945,21 @@ // Prepare for filling the reservoirs and heating the water setValveState( VPI, VALVE_STATE_OPEN ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); +#else setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); +#endif setValveState( VPO, VALVE_STATE_FILL_C_TO_NC ); setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); setValveState( VRI, VALVE_STATE_R2_C_TO_NC ); setValveState( VRF, VALVE_STATE_R1_C_TO_NC ); +#ifndef V_2_SYSTEM + setValveState( VRD1, VALVE_STATE_CLOSED ); + setValveState( VRD2, VALVE_STATE_OPEN ); +#else setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); +#endif // Turn on the RO pump setROPumpTargetFlowRate( RO_PUMP_TARGET_FLUSH_FILL_FLOW_RATE_LPM, MAX_RO_PUMP_FLUSH_FILL_PRESSURE_PSI ); @@ -930,7 +1018,11 @@ // Set the valves to drain R2 and no fill setValveState( VPI, VALVE_STATE_CLOSED ); setValveState( VBF, VALVE_STATE_OPEN ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); +#else setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NC ); +#endif setValveState( VDR, VALVE_STATE_RECIRC_C_TO_NC ); setValveState( VRC, VALVE_STATE_RECIRC_C_TO_NC ); @@ -998,7 +1090,12 @@ //TODO turn off CP1 and CP2 // Set the valves to transfer hot water from R1 to R2 and fill up R2. setValveState( VRO, VALVE_STATE_R2_C_TO_NC ); +#ifndef V_2_SYSTEM + setValveState( VRD1, VALVE_STATE_OPEN ); + setValveState( VRD2, VALVE_STATE_CLOSED ); +#else setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); +#endif setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); // Although there is fluid in both reservoirs, but they are set to empty @@ -1133,8 +1230,14 @@ // water does not enter the circulation path the membrane is cooling down setValveState( VPI, VALVE_STATE_CLOSED ); setValveState( VBF, VALVE_STATE_CLOSED ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); + setValveState( VRD1, VALVE_STATE_CLOSED ); +#else setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NC ); +#endif + stateTimer = getMSTimerCount(); state = DG_HEAT_DISINFECT_STATE_COOL_DOWN_RO_FILTER; } @@ -1196,6 +1299,9 @@ if ( ( TRUE == didTimeout( stateTimer, DRAIN_PUMP_START_TIME_IN_MIX_DRAIN_MS ) ) && ( isDrainPumpInMixDrainOn == FALSE ) ) { isDrainPumpInMixDrainOn = TRUE; +#ifndef V_2_SYSTEM + setValveState( VRD1, VALVE_STATE_OPEN ); +#endif // Turn on the drain pump to drain the reservoirs in open loop mode setDrainPumpTargetRPM( DRAIN_PUMP_RPM_IN_MIX_DRAIN ); @@ -1208,8 +1314,15 @@ } else if ( DG_RESERVOIR_REACHED_TARGET == rsrvr1Status ) { +#ifndef V_2_SYSTEM + // Done with draining reservoir 1 + setValveState( VRD1, VALVE_STATE_CLOSED ); // Set the drain valve to reservoir 2 + setValveState( VRD2, VALVE_STATE_OPEN ); +#else + // Set the drain valve to reservoir 2 setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); +#endif rsrvr2Status = DG_RESERVOIR_ABOVE_TARGET; stateTimer = getMSTimerCount(); @@ -1218,7 +1331,7 @@ else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr1Status ) { prevHeatDisinfectState = state; - state = DG_HEAT_DISINFECT_STATE_CANCEL_WATER_PATH; + state = DG_HEAT_DISINFECT_STATE_CANCEL_BASIC_PATH; } } @@ -1250,7 +1363,13 @@ // Set the valves to fill up R1 and overflow to R2 setValveState( VPI, VALVE_STATE_OPEN ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); + // Done with draining reservoir 2 + setValveState( VRD2, VALVE_STATE_CLOSED ); +#else setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); +#endif setValveState( VPO, VALVE_STATE_FILL_C_TO_NC ); setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); @@ -1268,7 +1387,7 @@ else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr2Status ) { prevHeatDisinfectState = state; - state = DG_HEAT_DISINFECT_STATE_CANCEL_WATER_PATH; + state = DG_HEAT_DISINFECT_STATE_CANCEL_BASIC_PATH; } return state; @@ -1301,7 +1420,11 @@ // Set the valves to rinse R2 to R1 and drain R1 setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); setValveState( VRO, VALVE_STATE_R2_C_TO_NC ); +#ifndef V_2_SYSTEM + setValveState( VRD1, VALVE_STATE_R1_C_TO_NC ); +#else setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); +#endif setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); @@ -1350,6 +1473,9 @@ { // Done with draining R1 signalDrainPumpHardStop(); +#ifndef V_2_SYSTEM + setValveState( VRD1, VALVE_STATE_CLOSED ); +#endif } else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr1Status ) { @@ -1374,10 +1500,18 @@ // De-energize all the valves and set the VDr to drain R2 setValveState( VPI, VALVE_STATE_CLOSED ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); +#else setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); +#endif setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); +#ifndef V_2_SYSTEM + setValveState( VRD2, VALVE_STATE_OPEN ); +#else setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); +#endif setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); @@ -1472,7 +1606,7 @@ U32 targetRPM = 0; // Stop all the actuators first then decide who should run next - resetActuators(); + deenergizeActuators(); // Check inlet dialysate and redundant outlet temperature sensors F32 TDi = getTemperatureValue( TEMPSENSORS_OUTLET_REDUNDANT ); //TODO change to TDi @@ -1488,7 +1622,11 @@ { // The fluid is hot so this is a mix drain. Set the VPd to direct the cold inlet fluid to drain setValveState( VPI, VALVE_STATE_OPEN ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); +#else setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NC ); +#endif targetRPM = DRAIN_PUMP_RPM_IN_MIX_DRAIN; cancellationMode = CANCELLATION_MODE_HOT; @@ -1513,8 +1651,13 @@ if ( DG_RESERVOIR_REACHED_TARGET == rsrvr2Status ) { +#ifndef V_2_SYSTEM // Set the drain valve to reservoir 1 + setValveState( VRD1, VALVE_STATE_OPEN ); +#else + // Set the drain valve to reservoir 1 setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); +#endif } } else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr2Status ) @@ -1580,7 +1723,11 @@ setValveState( VPI, VALVE_STATE_CLOSED ); setValveState( VBF, VALVE_STATE_CLOSED ); setValveState( VSP, VALVE_STATE_CLOSED ); - setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); +#else + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); +#endif setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); @@ -1606,7 +1753,7 @@ *************************************************************************/ static void failHeatDisinfect( void ) { - SET_ALARM_WITH_1_U32_DATA( alarm, prevHeatDisinfectState ) + SET_ALARM_WITH_1_U32_DATA( alarmDetectedPendingTrigger, prevHeatDisinfectState ) } /*********************************************************************//** @@ -1653,7 +1800,8 @@ else if ( TRUE == didTimeout( stateTimer, timeout ) ) { // Failed to fill ontime. Update the previous heat disinfect state and transition to basic cancellation - alarm = ALARM_ID_DG_RESERVOIR_FILL_TIMEOUT; + prevHeatDisinfectState = heatDisinfectState; + alarmDetectedPendingTrigger = ALARM_ID_DG_RESERVOIR_FILL_TIMEOUT; status = DG_RESERVOIR_NOT_REACHED_TARGET; } @@ -1690,7 +1838,8 @@ else if ( TRUE == didTimeout( stateTimer, timeout ) ) { // Failed to drain on time. Update the previous heat disinfect state and transition to basic cancellation - alarm = ALARM_ID_DG_RESERVOIR_DRAIN_TIMEOUT; + prevHeatDisinfectState = heatDisinfectState; + alarmDetectedPendingTrigger = ALARM_ID_DG_RESERVOIR_DRAIN_TIMEOUT; status = DG_RESERVOIR_NOT_REACHED_TARGET; } @@ -1733,7 +1882,7 @@ else if ( TRUE == didTimeout( rsrvrsVolMonitorTimer, RSRVRS_TARGET_VOL_OUT_TIMEOUT_MS ) ) { areRsrvrsLeaking = FALSE; - alarm = ALARM_ID_DG_RESERVOIR_LEAK_TIMEOUT; + alarmDetectedPendingTrigger = ALARM_ID_DG_RESERVOIR_LEAK_TIMEOUT; status = HEAT_DISINFECT_RSRVRS_LEAK_TIMEOUT; } } @@ -1754,11 +1903,11 @@ if ( TRUE == didTimeout( stateTimer, HEAT_DISINFECT_START_TEMP_TIMOUT_MS ) ) { // Heating up to minimum temperature for heat disinfect failed - alarm = ALARM_ID_DG_HEAT_DISINFECT_TARGET_TEMP_TIMEOUT; + alarmDetectedPendingTrigger = ALARM_ID_DG_HEAT_DISINFECT_TARGET_TEMP_TIMEOUT; status = HEAT_DISINFECT_HEAT_UP_TIMEOUT; } } - else if ( isPartialDisinfectInProgress != TRUE && ThdTemp > HEAT_DISINFECT_START_TEMPERATURE_C ) + else if ( ( isPartialDisinfectInProgress != TRUE ) && ( ThdTemp > HEAT_DISINFECT_START_TEMPERATURE_C ) ) { // The temperature of the coldest spot is in range to start the disinfect timer heatDisinfectTimer = getMSTimerCount();