Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -rabbb5848c695656121b00f3e55a4efaa83373ab8 -rb289f9d684263970108f7e4a7fa10c57cac538c2 --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision abbb5848c695656121b00f3e55a4efaa83373ab8) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision b289f9d684263970108f7e4a7fa10c57cac538c2) @@ -818,21 +818,6 @@ } } - // Check the measured flow against estimated flow - / - deltaFlow = FIFTY_PERCENT * estimatedFlow; // 50% estimated flow - measuredDialInFlow = getMeasuredDialInFlowRate(); - if ( ( TRUE == isDialInPumpRunning() ) && ( dialInPumpControlMode != PUMP_CONTROL_MODE_OPEN_LOOP ) ) - { - if ( ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_DIAL_IN_FLOW_CHECK_FAILURE, deltaFlow < fabs( estimatedFlow - measuredDialInFlow ) ) ) ) - { - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_DIAL_IN_FLOW_CHECK_FAILURE, measuredDialInFlow, estimatedFlow ); - } - } - else - { - isPersistentAlarmTriggered( ALARM_ID_HD_DIAL_IN_FLOW_CHECK_FAILURE, FALSE ); - } - return estimatedFlow; } @@ -1367,6 +1352,9 @@ static void checkDialInPumpFlowRate( void ) { F32 flow = getMeasuredDialInFlowRate(); + F32 estimatedFlow = flow; + F32 deltaFlow; + F32 measuredDialInFlow; // Range check on measure DPi flow rate. if ( ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_DIAL_IN_FLOW_OUT_OF_RANGE, ( flow > DIP_MAX_FLOW_RATE ) || ( flow < DIP_MIN_FLOW_RATE ) ) ) ) @@ -1408,6 +1396,21 @@ { errorDialInFlowVsMotorSpeedPersistTimerCtr = 0; } + + // Check the measured flow against estimated flow + measuredDialInFlow = getDGDialysateFlowRateLMin() / 1000; // mL/Min + deltaFlow = FIFTY_PERCENT * estimatedFlow; // 50% estimated flow + if ( ( TRUE == isDialInPumpRunning() ) && ( dialInPumpControlMode != PUMP_CONTROL_MODE_OPEN_LOOP ) ) + { + if ( ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_DIAL_IN_FLOW_CHECK_FAILURE, deltaFlow < fabs( estimatedFlow - measuredDialInFlow ) ) ) ) + { + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_DIAL_IN_FLOW_CHECK_FAILURE, measuredDialInFlow, estimatedFlow ); + } + } + else + { + isPersistentAlarmTriggered( ALARM_ID_HD_DIAL_IN_FLOW_CHECK_FAILURE, FALSE ); + } } /*********************************************************************//**