Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -rbdb9a1b636579c7bcfe95b329aa7e41ce161db13 -r30cbd9ff622e635f16df3801aabeb15dfaf5fff5 --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision bdb9a1b636579c7bcfe95b329aa7e41ce161db13) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 30cbd9ff622e635f16df3801aabeb15dfaf5fff5) @@ -76,7 +76,6 @@ #define DELAY_FMP_CHECK_START_BY_MS ( 10 * MS_PER_SECOND ) ///< Delay start of FMP check during dialysate deliver state by this amount of time (in ms). #define CONCENTRATE_TEST_COND_COLLECTION_DELAY_MS ( 5 * MS_PER_SECOND ) ///< Concentrate test conductivity data collection delay in milliseconds. -#define MAX_RO_REJECTION_RATIO_ALLOW 0.10F ///< Maximum RO rejection ratio. #define MAX_CPO_CONDUCTIVITY_ALLOW 100.0F ///< Maximum CPo sensor conductivity value. #define MIN_FILL_TARGET_TO_CHECK_RO_AND_CPO_ML 550 ///< Minimum fill target to check the RO and CPo alarms in milliliters. @@ -171,6 +170,8 @@ // NOTE: This variable should be initialized here because the init function is called every time and then it cannot be initialized there. This variable is // set via Dialin for calibration check purposes only static DIALIN_FILL_FOR_CAL_CHECK_T dialinFillForCalCheck = DIALIN_FILL_FOR_CAL_NONE; ///< Dialin fill for calibration check. +// NOTE: this variable should be initialized here because the init function is called every time and then this variable is set to 0.0. +static F32 roRejectionRatioFromHD = 0.0F; ///< RO rejection ratio from HD. static OVERRIDE_F32_T usedAcidVolumeML = { 0.0, 0.0, 0.0, 0.0 }; ///< The integrated acid concentration volume has been used in mL. static OVERRIDE_F32_T usedBicarbVolumeML = { 0.0, 0.0, 0.0, 0.0 }; ///< The integrated bicarb concentration volume has been used in mL. static OVERRIDE_U32_T fillModeDataPublishInterval = { FILL_MODE_DATA_PUB_INTERVAL, @@ -608,6 +609,20 @@ /*********************************************************************//** * @brief + * The setRORejectionRatio function sets the RO rejection ratio that has + * been received from the HD institutional record. + * @details Inputs: none + * @details Outputs: roRejectionRatioFromHD + * @param RO rejection ratio + * @return none + *************************************************************************/ +void setRORejectionRatio( F32 roRejectionRatio ) +{ + roRejectionRatioFromHD = roRejectionRatio; +} + +/*********************************************************************//** + * @brief * The handleTestInletWaterState function tests for inlet water quality * and if this is the first fill of a treatment, prime the acid and bicarb * lines before jumping to dialysate production state. @@ -625,6 +640,7 @@ // to dialysate production directly if ( TRUE == isThisTheFirstFill() ) { + sendRORejectionRatioRequestToHD(); result = DG_FILL_MODE_STATE_PRIME_CONCENTRATE_LINES; if ( TRUE == getTestConfigStatus( TEST_CONFIG_EXPEDITE_PRE_TREATMENT ) ) @@ -968,10 +984,10 @@ // Fault alarm per PRS 483 SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DG_OUTLET_PRIMARY_CONDUCTIVITY_OUT_OF_RANGE, avgCPo, MAX_CPO_CONDUCTIVITY_ALLOW ); } - if ( ( avgRR > MAX_RO_REJECTION_RATIO_ALLOW ) && ( isROOnlyModeEnabled() != TRUE ) ) + if ( ( avgRR > roRejectionRatioFromHD ) && ( isROOnlyModeEnabled() != TRUE ) ) { // Fault alarm per PRS 483 - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DG_RO_REJECTION_RATIO_OUT_OF_RANGE, avgRR, MAX_RO_REJECTION_RATIO_ALLOW ); + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DG_RO_REJECTION_RATIO_OUT_OF_RANGE, avgRR, roRejectionRatioFromHD ); } }