Index: firmware/App/Controllers/ConductivitySensors.c =================================================================== diff -u -rbcf9339af8a725054a8c936ae572bb95e2bcd3f0 -rf639bbc47806ddcefdbdce78a377cd87050872e5 --- firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision bcf9339af8a725054a8c936ae572bb95e2bcd3f0) +++ firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision f639bbc47806ddcefdbdce78a377cd87050872e5) @@ -62,11 +62,16 @@ #define COND_SENSOR_PERSISTENCE_PERIOD ( 5 * MS_PER_SECOND ) ///< Persistence period for conductivity sensor out of range error. #define RO_REJECTION_RATIO_PERSISTENCE_PERIOD ( 10 * MS_PER_SECOND ) ///< Persistence period for RO rejection ratio. -#define EMSTAT_PICO_MEASUREMENT_OFFSET 0x8000000 ///< Measurement offset for emstat pico measurement data. -#define EMSTAT_PICO_GOOD_STATUS 0x10 ///< Measurement good status. -#define EMSTAT_PICO_TIMING_NOT_MET_STATUS 0x11 ///< Measurement takes too long status. -#define EMSTAT_PICO_FIFO_EMPTY_MASK 0x8000 ///< Emstat Pico buffer empty indication bit. +#define EMSTAT_PICO_MEASUREMENT_OFFSET 0x8000000 ///< Emstat measurement offset. +// The below Emstat status values come from the MethodScript-v1_2-1.pdf. See page 10 table 4 for further information +// The first hex value is the status ID meaning that all of these are the status of the sensor. The second hex value is the content. +#define EMSTAT_PICO_STATUS_OK 0x10 ///< Emstat measurement good status. +#define EMSTAT_PICO_STATUS_TIMING_NOT_MET 0x11 ///< Emstat measurement takes too long status. +#define EMSTAT_PICO_STATUS_95_PCT_OF_MAX_ADC 0x12 ///< Emstat measurement overload, >95% of max ADC value status. +#define EMSTAT_PICO_STATUS_2_PCT_OF_MAX_ADC 0x14 ///< Emstat measurement underload, <2% of max ADC value status. +#define EMSTAT_PICO_STATUS_80_PCT_OF_MAX_ADC 0x18 ///< Emstat measurement overload warning, >80% of max ADC value status. +#define EMSTAT_PICO_FIFO_EMPTY_MASK 0x8000 ///< Emstat buffer empty indication bit. #define EMSTAT_NUM_OF_SENSORS_PER_BOARD 2 ///< Emstat Pico number of sensors per board. #define EMSTAT_CPI_OR_CD1_INDEX 0 ///< Emstat board CPi index number. #define EMSTAT_CPO_OR_CD2_INDEX 1 ///< Emstat board CPo index number. @@ -228,7 +233,6 @@ if ( ++condDataPublishCounter >= getU32OverrideValue( &conductivityDataPublishInterval ) ) { CONDUCTIVITY_DATA_T data; - calcRORejectionRatio(); data.roRejectionRatio = roRejectionRatio; data.cpi = getConductivityValue( CONDUCTIVITYSENSORS_CPI_SENSOR ); @@ -573,6 +577,7 @@ break; } +#ifndef DISABLE_FPGA_ALARMS_UNTIL_THE_NEW_PERSISTENT // Only process the FPGA error and count values if the DG Software is not in the POST mode if ( getCurrentOperationMode() != DG_MODE_INIT ) { @@ -592,6 +597,7 @@ } } } +#endif } /*********************************************************************//** @@ -609,7 +615,7 @@ { CONDUCTIVITY_SENSORS_T sensorId = readPackage->sensors[ boardSensorIndex ].condSnsr; condSensorStatus[ sensorId ].sensorStatus = hexStrToDec( (U08*)&receivedPackets->status, sizeof( receivedPackets->status ) ); - BOOL isSensorStatusBad = ( EMSTAT_PICO_GOOD_STATUS != condSensorStatus[ sensorId ].sensorStatus ? TRUE : FALSE ); + BOOL isSensorStatusBad = ( EMSTAT_PICO_STATUS_TIMING_NOT_MET == condSensorStatus[ sensorId ].sensorStatus ? TRUE : FALSE ); if ( FALSE == isSensorStatusBad ) { @@ -625,9 +631,10 @@ } // Check the conductivity sensors bad status alarm - //checkPersistentAlarm( ALARM_ID_DG_CONDUCTIVITY_SENSOR_BAD_STATUS, isSensorStatusBad, condSensorStatus[ sensorId ].sensorStatus, EMSTAT_PICO_GOOD_STATUS ); // TODO DVT is reporting bad status check it + checkPersistentAlarm( ALARM_ID_DG_CONDUCTIVITY_SENSOR_BAD_STATUS, isSensorStatusBad, condSensorStatus[ sensorId ].sensorStatus, + EMSTAT_PICO_STATUS_TIMING_NOT_MET ); - if ( EMSTAT_PICO_TIMING_NOT_MET_STATUS == condSensorStatus[ sensorId ].sensorStatus ) + if ( EMSTAT_PICO_STATUS_TIMING_NOT_MET == condSensorStatus[ sensorId ].sensorStatus ) { if ( ++condSensorStatus[ sensorId ].internalErrorCount > MAX_CONDUCTIVITY_SENSOR_FAILURES ) {