• No results found

Timer Instructions

6.4 Timer Examples

Statement list programming offers five types of timers to meet your automation needs. An example for each type is provided below.

Figures 6-4 and 6-5 provide examples of a pulse timer. The numbers in squares in the figures are keyed to explanations that follow Figure 6-4. The figures refer to the following STL program:

STL Explanation

A I 2.0

FR T 1

A I 2.1

L S5T#0H2M23S0MS SP T 1

A I 2.2

R T 1 A T 1

= Q 4.0

L T 1

T MW10

LC T 1

T MW12

Enable timer T 1.

Start timer T 1 as a pulse timer.

Reset timer T 1.

Check the signal state of timer T 1.

Load timer T 1.

I 2.0

I 2.1

I 2.2

Q 4.0 RLO at Enable input

RLO at Start input

RLO at Reset input

Timer response Check signal state of timer output.

Load timer: L, LC

t

  







 Introduction

Pulse Timer: SP

Timer Instructions

The following list describes the elements of Figures 6-4 and 6-5:

 A change in the RLO from 0 to 1 at the Start input starts the timer.

The programmed time t then elapses.

 When an RLO of 0 is applied to the Start input, the timer is reset.

 Checking the signal state of output Q 4.0 of the timer results in a signal state of 1 for the entire duration of the timer operation.

 If an RLO of 1 is applied to the Reset input, the timer is reset. As long as a signal state of 1 remains at the Start input, a change in the RLO from 1 to 0 at the Reset input has no influence on the timer.

 A change in the RLO from 0 to 1 at the Start input with the Reset signal applied causes the timer to start momentarily but to reset immediately because of the Reset statement that follows directly in the program (shown as a pulse line in the timing diagram in Figure 6-4). No checking result is obtained for this pulse, provided that the sequence of writing the statements as they appear above is observed.

 A change in the RLO from 0 to 1 at the Enable input while the timer is running restarts the timer. The time that is programmed is used as the current time for the restart. A change in the RLO from 1 to 0 at the Enable input has no effect.

If the RLO changes from 0 to 1 at the Enable input while the timer is not running and there is still an RLO of 1 at the Start input, the timer will also be started as a pulse with the time programmed.

A change in the RLO from 0 to 1 at the Enable input while there is still an RLO of 0 at the Start input has no effect on the timer.

I 2.0

I 2.1

I 2.2

Q 4.0 RLO at Enable input

RLO at Start input

RLO at Reset input

Timer response

Load timer: L, LC

t



t = programmed start time

t



Check signal state of timer output.

Figure 6-5 Pulse Timer Example, Part 2 Timer Instructions

Figures 6-6 and 6-7 provide examples of an extended pulse timer. The numbers in squares in the figures are keyed to explanations that follow Figure 6-6. The figures refer to the following STL program:

STL Explanation

Enable timer T 1.

Start timer T 1 as an extended pulse timer.

Reset timer T 1.

Check the signal state of timer T 1.

Load timer T 1 (binary coded).

Load timer T 1 (BCD coded).

I 2.0

Load timer: L, LC

t

   







t = programmed start time





Check signal state of timer output

Figure 6-6 Extended Pulse Timer Example, Part 1 Extended Pulse

Timer: SE

Timer Instructions

The following list describes the elements of Figures 6-6 and 6-7:

 A change in the RLO from 0 to 1 at the Start input starts the timer.

The programmed time t then elapses, regardless of a change in the RLO from 1 to 0 at the Start input.

 If the RLO changes from 0 to 1 before the time has elapsed, the timer is retriggered with the time that was programmed originally.

 Checking the signal state of the timer output produces a result of 1 for the entire duration of the timer operation.

 If an RLO of 1 is applied to the Reset input, the timer is reset. As long as a signal state of 1 remains at the Start input, a change in the RLO from 1 to 0 at the Reset input has no effect on the timer.

 A change in the RLO from 0 to 1 at the Start input with the Reset signal applied causes the timer to start momentarily but to reset immediately because of the Reset statement that follows directly in the program (shown as a pulse line in the timing diagram in Figure 6-6). No checking result is obtained for this pulse, provided that the sequence of writing the statements as they appear above is observed.

 A change in the RLO from 0 to 1 at the Enable input while the timer is running restarts the timer. The time that is programmed is used as the current time for the restart. A change in the RLO from 1 to 0 at the Enable input has no effect.

If the RLO changes from 0 to 1 at the Enable input while the timer is not running and there is still an RLO of 1 at the Start input, the timer will also be started as a pulse with the time programmed.

A change in the RLO from 0 to 1 at the Enable input while there is still an RLO of 0 at the Start input has no effect on the timer.

I 2.0

Load timer: L, LC

t



t = programmed start time

t

Figure 6-7 Extended Pulse Timer Example, Part 2 Timer Instructions

Figures 6-8 and 6-9 provide examples of an on-delay timer. The numbers in squares in the figures are keyed to explanations that follow Figure 6-8. The figures refer to the following STL program:

STL Explanation

Enable timer T 1.

Start timer T 1 as an on-delay timer.

Reset timer T 1.

Check the signal state of timer T 1.

Load timer T 1.

Load Timer: L, LC

t

 







t = programmed start time

t







Check signal state of timer output Q 4.0

Figure 6-8 On-Delay Timer Example, Part 1 On-Delay Timer:

SD

Timer Instructions

The following list describes the elements of Figures 6-8 and 6-9:

 A change in the RLO from 0 to 1 at the Start input starts the timer.

The programmed time t then elapses.

 When an RLO of 0 is applied to the Start input, the timer is reset.

 Checking the signal state of output Q 4.0 of the timer results in a signal state of 1 when the time has elapsed and the Start input is 1.

 If an RLO of 1 is applied to the Reset input, the timer is reset. As long as a signal state of 1 remains at the Start input, a change in the RLO from 1 to 0 at the Reset input has no effect on the timer.

 A change in the RLO from 0 to 1 at the Start input with the Reset signal applied causes the timer to start momentarily but to reset immediately because of the Reset statement that follows directly in the program (shown as a pulse line in the timing diagram in Figure 6-8). No checking result is obtained for this pulse, provided that the sequence of writing the statements as they appear above is observed.

 A change in the RLO from 0 to 1 at the Enable input while the timer is running restarts the timer. The time that is programmed is used as the current time for the restart. A change in the RLO from 1 to 0 at the Enable input has no effect.

If the RLO changes from 0 to 1 at the Enable input following normal operation of the timer, the timer is not affected

A change in the RLO from 0 to 1 at the Enable input after the timer was reset and while there is still an RLO of 1 at the Start input starts the timer. The time that is programmed is used as the current time.

I 2.0

Load timer: L, LC

t

 

t = programmed start time



Check signal state of timer output.

Figure 6-9 On-Delay Timer Example, Part 2 Timer Instructions

Figures 6-10 and 6-11 provide examples of a retentive on-delay timer. The numbers in squares in the figures are keyed to explanations that follow Figure 6-10. The figures refer to the following STL program:

STL Explanation

Enable timer T 1.

Start timer T 1 as a retentive on-delay timer.

Reset timer T 1.

Check the signal state of timer T 1.

Load timer T 1.

Load timer: L, LC

t

t = programmed start time

 of timer output Q 4.0

Figure 6-10 Retentive On-Delay Timer Example, Part 1

The following list describes the elements of Figures 6-10 and 6-11:

 A change in the RLO from 0 to 1 at the Start input starts the timer.

The programmed time t then elapses regardless of a change in the Retentive On-Delay

Timer: SS

Timer Instructions

 The result of checking the signal state of output Q 4.0 changes to 0 only when the RLO at the Reset input is 1.

 If an RLO of 1 is applied to the Reset input, the timer is reset. As long as a signal state of 1 remains at the Start input, a change in the RLO from 1 to 0 at the Reset input has no influence on the timer.

 A change in the RLO from 0 to 1 at the Start input with the Reset signal applied causes the timer to start momentarily but to reset immediately because of the Reset statement that follows directly in the program (shown as a pulse line in the timing diagram in

Figure 6-10). No checking result is obtained for this pulse, provided that the sequence of writing the statements as they appear above is observed.

 When the RLO at the Enable input changes from 0 to 1 while the timer is running and the RLO at the Start input of the timer is 1, the timer is restarted. The time that is programmed is used as the current time for the restart. A change in the RLO from 1 to 0 at the Enable input has no effect on the timer.

The timer is not affected when the RLO at the Enable input changes from 0 to 1 following normal operation of the timer.

When the RLO at the Enable input changes from 0 to 1 while the timer is running and the RLO at the Start input of the timer is 0, the timer is not affected.

If the RLO at the Enable input changes from 0 to 1 when the timer is reset and the RLO at the Start input is still 1, the timer is restarted. The time that is programmed is used as the current time for the restart.

Load timer: L, LC

t = programmed start time

t

Figure 6-11 Retentive On-Delay Timer Example, Part 2 Timer Instructions

Figures 6-12 and 6-13 provide examples of an off-delay timer. The numbers in squares in the figures are keyed to explanations that follow Figure 6-12.

The figures refer to the following STL program:

STL Explanation

Enable timer T 1.

Start timer T 1 as an off-delay timer.

Reset timer T 1.

Check the signal state of timer T 1.

Load timer T 1.

Load timer: L, LC

t = programmed start time

t t

Figure 6-12 Off-Delay Timer Example, Part 1 Off-Delay Timer:

SF

Timer Instructions

The following list describes the elements of Figures 6-12 and 6-13:

 A change in the RLO from 0 to 1 at the Start input causes a change from 0 to 1 at output Q 4.0 of the timer. A change in the RLO from 1 to 0 at the Start input starts the timer. The programmed time t then elapses.

 If an RLO of 1 reappears at the Start input, the timer is reset.

 Checking the signal state of output Q 4.0 of the timer results in a signal state of 1 if the RLO at the Start input is 1 and if the time has not yet elapsed.

 If an RLO of 1 is applied to the Reset input, the timer is reset.

Checking the signal state of the timer then results in 0. A change in RLO from 1 to 0 at the Reset input has no influence on the timer.

 A 1 applied to the Reset input while the timer is not running has no effect on the timer.

 A change in the RLO from 1 to 0 at the Start input while the Reset signal is applied causes the timer to start momentarily but to reset immediately because of the Reset statement that follows directly in the program (shown as a pulse line in the timing diagram in

Figure 6-12). Checking the signal state of the timer then results in 0.

The timer is not affected if the RLO at the Enable input changes from 0 to 1 while the timer is not running. A change in the RLO from 1 to 0 also has no effect on the timer.

If the RLO at the Enable input changes from 0 to 1 while the timer is running, the timer is restarted. The time that is programmed is used as the current time for the restart.

I 2.0

I 2.1

I 2.2

Q 4.0 RLO at Enable input

RLO at Start input

RLO at Reset input

Timer response

Load timer: L, LC

t

t = programmed start time

Check signal state of timer output.

Figure 6-13 Off-Delay Timer Example, Part 2 Timer Instructions