186 - PAC Designer: How to create a 10-second timer in an ispPAC-POWR1220AT8 device?
Background: The maximum Timer setting in the ispPAC-POWR1220AT8 device is 1966.08 ms. If users would like to use a longer timer then they must create a counter to accumulate timer pulses and use the counter output to indicate the time sequence.
To create a 10-second timer, set a Timer to 1966 ms and then accumulate 5 Timer pulses to approximate a 10-second timer. Use the supervisory equations section to create the counter and a code example for this is shown below:
Equation 0: TIMER2_GATE.D = NOT TIMER2_TC
Equation 1: Cnt0.D = Cnt0 AND NOT TIMER2_TC OR NOT Cnt0 AND TIMER2_TC
Equation 2: Cnt1.D = ( NOT Cnt1 AND Cnt0 AND TIMER2_TC ) OR ( Cnt1 AND NOT ( Cnt0 AND TIMER2_TC ) )
Equation 3: Cnt2.D = ( NOT Cnt2 AND Cnt1 AND Cnt0 AND TIMER2_TC ) OR ( Cnt2 AND NOT ( Cnt1 AND Cnt0 AND TIMER2_TC ) )
Equation 4: Ten_sec_timer.D = ( Cnt2 AND NOT Cnt1 AND Cnt0 )
Then, set Timer2 to 1966.08 ms for this example to create a 9.8-second timer.