Index: firmware/App/Modes/ModeHeatDisinfect.c =================================================================== diff -u -re608f0a2bda2ad8df59a604a511cbd2a1c323dc3 -r3850bef541c43c1fb81663eb7d1ca6c98e933627 --- firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision e608f0a2bda2ad8df59a604a511cbd2a1c323dc3) +++ firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision 3850bef541c43c1fb81663eb7d1ca6c98e933627) @@ -467,9 +467,6 @@ // Check if the current operation mode is heat disinfect if ( DG_MODE_HEAT == getCurrentOperationMode() ) { -#ifndef _RELEASE_ - nelsonSupport = NELSON_NONE; -#endif // Reset all the actuators deenergizeActuators( NO_PARK_CONC_PUMPS ); @@ -485,14 +482,14 @@ #ifndef _RELEASE_ /*********************************************************************//** * @brief - * The setNelsonSupportMode function sets the requested Nelson support + * The setHeatNelsonSupportMode function sets the requested Nelson support * mode (i.e. inoculate, ...) * @details Inputs: none * @details Outputs: nelsonSupport * @param support the type Nelson support (i.e. inoculate, heat disinfect) * @return none *************************************************************************/ -void setNelsonSupportMode( NELSON_SUPPORT_T support ) +void setHeatNelsonSupportMode( NELSON_SUPPORT_T support ) { nelsonSupport = support; } @@ -1590,8 +1587,6 @@ #ifndef _RELEASE_ if ( nelsonSupport != NELSON_NONE ) { - // Clear the variable to be out of Nelson support - nelsonSupport = NELSON_NONE; requestNewOperationMode( DG_MODE_STAN ); } else @@ -1620,18 +1615,7 @@ SET_ALARM_WITH_1_U32_DATA( alarmDetectedPendingTrigger, prevHeatDisinfectState ) } -#ifndef _RELEASE_ - if ( nelsonSupport != NELSON_NONE ) - { - // Clear the variable to be out of Nelson support - nelsonSupport = NELSON_NONE; - requestNewOperationMode( DG_MODE_STAN ); - } - else -#endif - { - requestNewOperationMode( DG_MODE_FAUL ); - } + requestNewOperationMode( DG_MODE_FAUL ); } /*********************************************************************//** @@ -2035,44 +2019,84 @@ *************************************************************************/ static void setNelsonSupportConditions( void ) { - F32 temperature = 0.0F; - F32 stopTemperature = 0.0F; - U32 disinfectTime = 0; + // The target temperature is set to low so the heater will turn on but it will not heat because + // we are very close to the target. Set the stop temperature to a temperature lower by a couple degrees + // make sure the timer will continuously count against the disinfection time to inoculate. + // NOTE: this is not part of the commercial code so no #defines + F32 temperature = 6.0F; + F32 stopTemperature = temperature - 5.0F; + U32 disinfectTime = 2 * MIN_PER_HOUR * SEC_PER_MIN * MS_PER_SECOND; + concPumpsStartTemperatureC = temperature; + switch ( nelsonSupport ) { case NELSON_INOCULATE: - // The target temperature is set to low so the heater will turn on but it will not heat because - // we are very close to the target. Set the stop temperature to a temperature lower by a couple degrees - // make sure the timer will continuously count against the disinfection time to inoculate. - // NOTE: this is not part of the commercial code so no #defines - temperature = 20.0F; - stopTemperature = temperature - 5.0F; - disinfectTime = 2 * MIN_PER_HOUR * SEC_PER_MIN * MS_PER_SECOND; - heatDisinfectState = DG_HEAT_DISINFECT_STATE_START; - concPumpsStartTemperatureC = temperature; - timeStatus[ RO_AT_77_C ].startTempC = temperature; timeStatus[ RO_AT_77_C ].startTimeMS = 0; timeStatus[ RO_AT_77_C ].stopTempC = stopTemperature; timeStatus[ RO_AT_77_C ].targetTimeMS = HEAT_DISINFECT_AT_77_C_TIME_MS; + timeStatus[ RO_AT_77_C ].tempSensor = TEMPSENSORS_HEAT_DISINFECT; timeStatus[ RO_AT_82_C ].startTempC = temperature; timeStatus[ RO_AT_82_C ].startTimeMS = 0; timeStatus[ RO_AT_82_C ].stopTempC = stopTemperature; timeStatus[ RO_AT_82_C ].targetTimeMS = HEAT_DISINFECT_AT_82_C_TIME_MS; + timeStatus[ RO_AT_82_C ].tempSensor = TEMPSENSORS_HEAT_DISINFECT; timeStatus[ RSRVR_AT_77_C ].startTempC = temperature; timeStatus[ RSRVR_AT_77_C ].startTimeMS = 0; timeStatus[ RSRVR_AT_77_C ].stopTempC = stopTemperature; timeStatus[ RSRVR_AT_77_C ].targetTimeMS = disinfectTime; + timeStatus[ RSRVR_AT_77_C ].tempSensor = TEMPSENSORS_INLET_DIALYSATE; timeStatus[ RSRVR_AT_82_C ].startTempC = temperature; timeStatus[ RSRVR_AT_82_C ].startTimeMS = 0; timeStatus[ RSRVR_AT_82_C ].stopTempC = stopTemperature; timeStatus[ RSRVR_AT_82_C ].targetTimeMS = disinfectTime; + timeStatus[ RSRVR_AT_82_C ].tempSensor = TEMPSENSORS_INLET_DIALYSATE; break; + case NELSON_POS_CONTROL_HEAT_DISINFECT: + timeStatus[ RO_AT_77_C ].startTempC = temperature; + timeStatus[ RO_AT_77_C ].startTimeMS = 0; + timeStatus[ RO_AT_77_C ].stopTempC = stopTemperature; + timeStatus[ RO_AT_77_C ].targetTimeMS = disinfectTime; + timeStatus[ RO_AT_77_C ].tempSensor = TEMPSENSORS_HEAT_DISINFECT; + + timeStatus[ RO_AT_82_C ].startTempC = temperature; + timeStatus[ RO_AT_82_C ].startTimeMS = 0; + timeStatus[ RO_AT_82_C ].stopTempC = stopTemperature; + timeStatus[ RO_AT_82_C ].targetTimeMS = disinfectTime; + timeStatus[ RO_AT_82_C ].tempSensor = TEMPSENSORS_HEAT_DISINFECT; + + timeStatus[ RSRVR_AT_77_C ].startTempC = temperature; + timeStatus[ RSRVR_AT_77_C ].startTimeMS = 0; + timeStatus[ RSRVR_AT_77_C ].stopTempC = stopTemperature; + timeStatus[ RSRVR_AT_77_C ].targetTimeMS = HEAT_DISINFECT_AT_82_C_TIME_MS; + timeStatus[ RSRVR_AT_77_C ].tempSensor = TEMPSENSORS_INLET_DIALYSATE; + + timeStatus[ RSRVR_AT_82_C ].startTempC = temperature; + timeStatus[ RSRVR_AT_82_C ].startTimeMS = 0; + timeStatus[ RSRVR_AT_82_C ].stopTempC = stopTemperature; + timeStatus[ RSRVR_AT_82_C ].targetTimeMS = HEAT_DISINFECT_AT_82_C_TIME_MS; + timeStatus[ RSRVR_AT_82_C ].tempSensor = TEMPSENSORS_INLET_DIALYSATE; + setValveState( VPI, VALVE_STATE_CLOSED ); + setValveState( VBF, VALVE_STATE_OPEN ); + setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); + setValveState( VDR, VALVE_STATE_RECIRC_C_TO_NC ); + setValveState( VRC, VALVE_STATE_RECIRC_C_TO_NC ); + setValveState( VPO, VALVE_STATE_FILL_C_TO_NC ); + setValveState( VRF, VALVE_STATE_R1_C_TO_NC ); + setValveState( VRO, VALVE_STATE_R1_C_TO_NO ); + setValveState( VRI, VALVE_STATE_R2_C_TO_NC ); + setValveState( VRD1, VALVE_STATE_CLOSED ); + setValveState( VRD2, VALVE_STATE_OPEN ); + signalROPumpHardStop(); + setDrainPumpTargetOutletFlowLPM( HEAT_DISINFECT_TARGET_RO_FLOW_LPM ); + heatDisinfectState = DG_HEAT_DISINFECT_STATE_DISINFECT_R1_TO_R2; + break; + case NELSON_HEAT_DISINFECT: // Set the valves to drain R2 and no fill setValveState( VPI, VALVE_STATE_CLOSED ); @@ -2101,6 +2125,7 @@ case NELSON_NONE: default: + // Do nothing for these cases. break; } }