Index: firmware/App/Controllers/UVReactors.c =================================================================== diff -u -r19ddae332910253204721af6204594467096f468 -rae9755ad4c929ce5c75c97e856e62f7065355abb --- firmware/App/Controllers/UVReactors.c (.../UVReactors.c) (revision 19ddae332910253204721af6204594467096f468) +++ firmware/App/Controllers/UVReactors.c (.../UVReactors.c) (revision ae9755ad4c929ce5c75c97e856e62f7065355abb) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2020-2023 Diality Inc. - All Rights Reserved. +* Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file UVReactors.c * * @author (last) Dara Navaei -* @date (last) 03-Jan-2023 +* @date (last) 05-Apr-2024 * * @author (original) Dara Navaei * @date (original) 24-Nov-2020 @@ -137,9 +137,10 @@ setReactorEnableStatus( reactor, PIN_SIGNAL_LOW ); } - initPersistentAlarm( ALARM_ID_UV_REACTOR_NOT_HEALTHY, MAX_ALLOWED_UNHEALTHY_REACTOR_PERIOD, MAX_ALLOWED_UNHEALTHY_REACTOR_PERIOD ); - initPersistentAlarm( ALARM_ID_DG_INLET_UV_REACTOR_ON_WITH_NO_FLOW, UV_REACTORS_ON_NO_FLOW_TIMEOUT_MS, UV_REACTORS_ON_NO_FLOW_TIMEOUT_MS ); - initPersistentAlarm( ALARM_ID_DG_OUTLET_UV_REACTOR_ON_WITH_NO_FLOW, UV_REACTORS_ON_NO_FLOW_TIMEOUT_MS, UV_REACTORS_ON_NO_FLOW_TIMEOUT_MS ); + initPersistentAlarm( ALARM_ID_DG_INLET_UV_REACTOR_NOT_HEALTHY, 0, MAX_ALLOWED_UNHEALTHY_REACTOR_PERIOD ); + initPersistentAlarm( ALARM_ID_DG_OUTLET_UV_REACTOR_NOT_HEALTHY, 0, MAX_ALLOWED_UNHEALTHY_REACTOR_PERIOD ); + initPersistentAlarm( ALARM_ID_DG_INLET_UV_REACTOR_ON_WITH_NO_FLOW, 0, UV_REACTORS_ON_NO_FLOW_TIMEOUT_MS ); + initPersistentAlarm( ALARM_ID_DG_OUTLET_UV_REACTOR_ON_WITH_NO_FLOW, 0, UV_REACTORS_ON_NO_FLOW_TIMEOUT_MS ); } /*********************************************************************//** @@ -354,11 +355,11 @@ // Check which reactor has not been healthy and raise an alarm if ( FALSE == isInletHealthy ) { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_UV_REACTOR_NOT_HEALTHY, INLET_UV_REACTOR ); + activateAlarmNoData( ALARM_ID_DG_INLET_UV_REACTOR_NOT_HEALTHY ); } - else + if ( FALSE == isOutletHealthy ) { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_UV_REACTOR_NOT_HEALTHY, OUTLET_UV_REACTOR ); + activateAlarmNoData( ALARM_ID_DG_OUTLET_UV_REACTOR_NOT_HEALTHY ); } } @@ -382,8 +383,14 @@ *************************************************************************/ static UV_REACTOR_STATE_T handleUVReactorStateOff( UV_REACTORS_T reactor ) { - UV_REACTOR_STATE_T state = UV_REACTOR_STATE_OFF; + UV_REACTOR_STATE_T state = UV_REACTOR_STATE_OFF; + ALARM_ID_T reactorHealthAlarm = ( INLET_UV_REACTOR == reactor ? ALARM_ID_DG_INLET_UV_REACTOR_NOT_HEALTHY : ALARM_ID_DG_OUTLET_UV_REACTOR_NOT_HEALTHY ); + ALARM_ID_T reactorFlowAlarm = ( INLET_UV_REACTOR == reactor ? ALARM_ID_DG_INLET_UV_REACTOR_ON_WITH_NO_FLOW : ALARM_ID_DG_OUTLET_UV_REACTOR_ON_WITH_NO_FLOW ); + // When the reactor is off, clear its health and on with no flow alarms + checkPersistentAlarm( reactorHealthAlarm, FALSE, 0.0F, 0.0F ); + checkPersistentAlarm( reactorFlowAlarm, FALSE, 0.0F, 0.0F ); + // Set the health status to be off. When the reactor is off, it does not report its health status reactorsStatus[ reactor ].healthStatus.data = (U32)UV_REACTOR_OFF; @@ -409,6 +416,7 @@ { UV_REACTOR_STATE_T state = UV_REACTOR_STATE_ON; BOOL isReactorUnhealthy = ( UV_REACTOR_HEALTHY == getUVReactorHealth( reactor ) ? FALSE : TRUE ); + ALARM_ID_T reactorAlarm = ( INLET_UV_REACTOR == reactor ? ALARM_ID_DG_INLET_UV_REACTOR_NOT_HEALTHY : ALARM_ID_DG_OUTLET_UV_REACTOR_NOT_HEALTHY ); // Update the UV reactor's health. It should be either healthy (1) or not healthy (0) reactorsStatus[ reactor ].healthStatus.data = getReactorHealth( reactor ); @@ -417,9 +425,9 @@ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_UV_REACTORS ) != SW_CONFIG_ENABLE_VALUE ) #endif { - checkPersistentAlarm( ALARM_ID_UV_REACTOR_NOT_HEALTHY, isReactorUnhealthy, (U32)reactor, MAX_ALLOWED_UNHEALTHY_REACTOR_PERIOD ); + checkPersistentAlarm( reactorAlarm, isReactorUnhealthy, (U32)reactor, MAX_ALLOWED_UNHEALTHY_REACTOR_PERIOD ); - if ( TRUE == isAlarmActive( ALARM_ID_UV_REACTOR_NOT_HEALTHY ) ) + if ( TRUE == isAlarmActive( reactorAlarm ) ) { // The UV reactor is not healthy turn it off and trigger the alarm reactorsStatus[ reactor ].switchState = TURN_OFF;