Index: firmware/App/Controllers/ConductivitySensors.c =================================================================== diff -u -rd70d93528b59ef7b09032a3bf4128bee0ff6e297 -r35b79680b35e741c9b3928068ea1d3b029f42877 --- firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision d70d93528b59ef7b09032a3bf4128bee0ff6e297) +++ firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 35b79680b35e741c9b3928068ea1d3b029f42877) @@ -647,11 +647,27 @@ *************************************************************************/ static F32 getCalibrationAppliedConductivityValue( U32 sensorId, F32 compensatedValue ) { - F32 conductivity = pow( compensatedValue, 4 ) * condSensorsCalRecord.condSensors[ (CAL_DATA_DG_COND_SENSORS_T)sensorId ].fourthOrderCoeff + - pow( compensatedValue, 3 ) * condSensorsCalRecord.condSensors[ (CAL_DATA_DG_COND_SENSORS_T)sensorId ].thirdOrderCoeff + - pow( compensatedValue, 2 ) * condSensorsCalRecord.condSensors[ (CAL_DATA_DG_COND_SENSORS_T)sensorId ].secondOrderCoeff + - compensatedValue * condSensorsCalRecord.condSensors[ (CAL_DATA_DG_COND_SENSORS_T)sensorId ].gain + - condSensorsCalRecord.condSensors[ (CAL_DATA_DG_COND_SENSORS_T)sensorId ].offset; + CAL_DATA_DG_COND_SENSORS_T id = (CAL_DATA_DG_COND_SENSORS_T)sensorId; + F32 conductivity = 0.0F; + + if ( DG_MODE_CHEM == getCurrentOperationMode() ) + { + // If the mode is in chemical disinfect, use the chemical disinfect calibration data for CD1 and CD2 + if ( CAL_DATA_CD1_COND_SENSOR == id ) + { + id = CAL_DATA_CD1_CHEM_DIS_COND_SENSOR; + } + else if ( CAL_DATA_CD2_COND_SENSOR == id ) + { + id = CAL_DATA_CD2_CHEM_DIS_COND_SENSOR; + } + } + + conductivity = pow( compensatedValue, 4 ) * condSensorsCalRecord.condSensors[ id ].fourthOrderCoeff + + pow( compensatedValue, 3 ) * condSensorsCalRecord.condSensors[ id ].thirdOrderCoeff + + pow( compensatedValue, 2 ) * condSensorsCalRecord.condSensors[ id ].secondOrderCoeff + + compensatedValue * condSensorsCalRecord.condSensors[ id ].gain + + condSensorsCalRecord.condSensors[ id ].offset; return conductivity; }