Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -rb4f599b29259cc0d545e5513dd5f27dbae58332b -rc03c93100453ef802a3f7d98ad6d22d4d9d00498 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision b4f599b29259cc0d545e5513dd5f27dbae58332b) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision c03c93100453ef802a3f7d98ad6d22d4d9d00498) @@ -627,8 +627,12 @@ // Check both spent and fresh side fill is complete isBothFillsComplete = ( TRUE == isSpentFillComplete ) && ( TRUE == isPressureStabilizedDuringFill ); isFirstCycleNotDone = ( FALSE == isFirstCycleBCSwitchingCompleted ); - isFillCompleteOrFirstCycle = isBothFillsComplete || isFirstCycleNotDone; + if ( FALSE == getBalChamberSwitchingOnlyStatus() ) + { + isFillCompleteOrFirstCycle = isBothFillsComplete || isFirstCycleNotDone; + } + if ( ( TRUE == isFillCompleteOrFirstCycle ) || ( ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ) && ( TRUE == getBalChamberSwitchingOnlyStatus() ) ) ) { @@ -704,8 +708,11 @@ } } else - { - state = BAL_CHAMBER_STATE2_FILL_START; + { // For Balancing Chamber Switch Only command, change state as per the switching period + if ( currentBalChamberSwitchingCounter >= balChamberSwitchingPeriod ) + { + state = BAL_CHAMBER_STATE2_FILL_START; + } } // Clear the switching only on request flag. @@ -847,8 +854,12 @@ // Check switching cycle time or pressure check for valve closure isBothFillsComplete = ( TRUE == isSpentFillComplete ) && ( TRUE == isPressureStabilizedDuringFill ); isFirstCycleNotDone = ( FALSE == isFirstCycleBCSwitchingCompleted ); - isFillCompleteOrFirstCycle = isBothFillsComplete || isFirstCycleNotDone; + if ( FALSE == getBalChamberSwitchingOnlyStatus() ) + { + isFillCompleteOrFirstCycle = isBothFillsComplete || isFirstCycleNotDone; + } + if ( ( TRUE == isFillCompleteOrFirstCycle ) || ( ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ) && ( TRUE == getBalChamberSwitchingOnlyStatus() ) ) ) { @@ -925,7 +936,11 @@ } else { - state = BAL_CHAMBER_STATE1_FILL_START; + // For Balancing Chamber Switch Only command, change state as per the switching period + if ( currentBalChamberSwitchingCounter >= balChamberSwitchingPeriod ) + { + state = BAL_CHAMBER_STATE1_FILL_START; + } } // Trigger pressure drop alarm after first cycle of balancing chamber switching complete