Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -re608f0a2bda2ad8df59a604a511cbd2a1c323dc3 -r3850bef541c43c1fb81663eb7d1ca6c98e933627 --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision e608f0a2bda2ad8df59a604a511cbd2a1c323dc3) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 3850bef541c43c1fb81663eb7d1ca6c98e933627) @@ -218,8 +218,8 @@ /*********************************************************************//** * @brief * The isHeaterOn function returns the heater status whether it is on or off - * @details Inputs: none - * @details Outputs: heaterStatus + * @details Inputs: heaterStatus + * @details Outputs: none * @return heater on/off status *************************************************************************/ BOOL isHeaterOn( DG_HEATERS_T heater ) Index: firmware/App/Modes/ModeFault.c =================================================================== diff -u -r6499ea25921fcf67826fa0c35bb03caf411ba542 -r3850bef541c43c1fb81663eb7d1ca6c98e933627 --- firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision 6499ea25921fcf67826fa0c35bb03caf411ba542) +++ firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision 3850bef541c43c1fb81663eb7d1ca6c98e933627) @@ -18,7 +18,9 @@ #include "ConcentratePumps.h" #include "DrainPump.h" #include "Heaters.h" +#include "ModeChemicalDisinfect.h" #include "ModeFault.h" +#include "ModeHeatDisinfect.h" #include "NVDataMgmt.h" #include "OperationModes.h" #include "ROPump.h" @@ -88,6 +90,11 @@ // the RTC time is read every second which requires the semaphore. releaseSemaphore( SEMAPHORE_RTC ); +#ifndef _RELEASE_ + setHeatNelsonSupportMode( NELSON_NONE ); + setChemNelsonSupportMode( NELSON_NONE ); +#endif + return faultState; } 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; } } Index: firmware/App/Modes/ModeHeatDisinfect.h =================================================================== diff -u -r86a4c29675dc34118aa9d4b55ead1d710a45ec10 -r3850bef541c43c1fb81663eb7d1ca6c98e933627 --- firmware/App/Modes/ModeHeatDisinfect.h (.../ModeHeatDisinfect.h) (revision 86a4c29675dc34118aa9d4b55ead1d710a45ec10) +++ firmware/App/Modes/ModeHeatDisinfect.h (.../ModeHeatDisinfect.h) (revision 3850bef541c43c1fb81663eb7d1ca6c98e933627) @@ -52,7 +52,7 @@ BOOL stopDGHeatDisinfect( void ); // Stop DG heat disinfect #ifndef _RELEASE_ -void setNelsonSupportMode( NELSON_SUPPORT_T support ); +void setHeatNelsonSupportMode( NELSON_SUPPORT_T support ); #endif /**@}*/ Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r86a4c29675dc34118aa9d4b55ead1d710a45ec10 -r3850bef541c43c1fb81663eb7d1ca6c98e933627 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 86a4c29675dc34118aa9d4b55ead1d710a45ec10) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 3850bef541c43c1fb81663eb7d1ca6c98e933627) @@ -20,7 +20,9 @@ #include "DrainPump.h" #include "Heaters.h" #include "MessageSupport.h" +#include "ModeChemicalDisinfect.h" #include "ModeFault.h" +#include "ModeHeatDisinfect.h" #include "ModeStandby.h" #include "NVDataMgmt.h" #include "OperationModes.h" @@ -125,7 +127,8 @@ setCPLDCleanLEDColor( CPLD_CLEAN_LED_OFF ); #ifndef _RELEASE_ - + setHeatNelsonSupportMode( NELSON_NONE ); + setChemNelsonSupportMode( NELSON_NONE ); #endif return standbyState; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -re608f0a2bda2ad8df59a604a511cbd2a1c323dc3 -r3850bef541c43c1fb81663eb7d1ca6c98e933627 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision e608f0a2bda2ad8df59a604a511cbd2a1c323dc3) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 3850bef541c43c1fb81663eb7d1ca6c98e933627) @@ -4330,19 +4330,21 @@ // verify payload length if ( sizeof( U32 ) == message->hdr.payloadLen ) { + NELSON_SUPPORT_T nelson; + memcpy( &payload, message->payload, sizeof( U32 ) ); - NELSON_SUPPORT_T nelson = (NELSON_SUPPORT_T)payload; + nelson = (NELSON_SUPPORT_T)payload; switch( nelson ) { case NELSON_INOCULATE: - setNelsonSupportMode( nelson ); + setHeatNelsonSupportMode( nelson ); requestNewOperationMode( DG_MODE_HEAT ); break; case NELSON_HEAT_DISINFECT: - setNelsonSupportMode( nelson ); + setHeatNelsonSupportMode( nelson ); requestNewOperationMode( DG_MODE_HEAT ); break; @@ -4351,13 +4353,17 @@ requestNewOperationMode( DG_MODE_CHEM ); break; + case NELSON_POS_CONTROL_HEAT_DISINFECT: + setHeatNelsonSupportMode( nelson ); + requestNewOperationMode( DG_MODE_HEAT ); + case NELSON_CHEM_DISINFECT: setChemNelsonSupportMode( nelson ); requestNewOperationMode( DG_MODE_CHEM ); break; case NELSON_DRAIN_SAMPLES: - setNelsonSupportMode( nelson ); + setHeatNelsonSupportMode( nelson ); requestNewOperationMode( DG_MODE_HEAT ); break; }