Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -r809b9916241453e182e626d04ae5b1934f019fcc -r34e5bf0c392cad4235b212c51f9b54cf16bb5581 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 809b9916241453e182e626d04ae5b1934f019fcc) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 34e5bf0c392cad4235b212c51f9b54cf16bb5581) @@ -672,8 +672,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() ) ) ) { @@ -749,8 +753,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. @@ -908,8 +915,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() ) ) ) { @@ -986,7 +997,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