3.2.2 Relay Timing
This example monitors relay timing in two phases. The first phase is the mechanical open/close stage, where the contacts are moving and may not be at stable levels. During this phase, the voltage on the output is allowed to be at invalid or unstable levels. These parameters are specified in the relay data sheet as the operate time/release time and are entered in the program as the constants RELAY_CLOSE_TIME_MAX and RELAY_OPEN_TIME_MAX.
The next phase is the settling time. Capacitance, start-up currents, and other activities may cause the output to drop or be invalid during this phase, but once it has risen to a valid level, it is assumed that it has stabilized at this point. Once this occurs, the program switches into the RELAY_CLOSED or RELAY_OPEN state. The length of time in this phase is determined by circuit requirements and entered as RELAY_MARGIN.