Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r0f9838d6b8606a6a9853ccb6157e4c25d70ddd02 -r8eb118992bbb2f40666c68be20de57c5eb34b5dc --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 0f9838d6b8606a6a9853ccb6157e4c25d70ddd02) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 8eb118992bbb2f40666c68be20de57c5eb34b5dc) @@ -1208,6 +1208,10 @@ if ( valvesStatus[ valve ].positionOutOfRangeCounter > MAX_POS_DEVIATION_TIME_INTERVAL_COUNTER ) { + // If the valve's deviation from target was more than the counts for the define period of time trigger the alarm. + // Also, set the state to Idle so in the fault mode, the valve can transition to Pos C. The exec state is directly set here + // because this is a monitor function that is called in the controller function. + valvesStatus[ valve ].execState = VALVE_STATE_IDLE; SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_VALVE_POSITION_OUT_OF_RANGE, (U32)valve, currentPosition ); } else if ( ( abs( currentPosition - commandedPosition ) < MAX_DEVIATION_FROM_TARGET_IN_COUNTS ) &&