Timers
Timers
Timers
Timers
Timers are used to operate an output for a certain time or wait a certain time before operating an output. In Siemens S7-300 PLC timers have an area reserved for them in the memory of your CPU. This memory area reserves one 16-bit word for each timer address. The ladder logic instruction set supports 256 timers.
Siemens S7-300 PLC can be programmed with five types of timers: S_PULSE, S_PEXT, S_ODT, S_ODTS and S_OFFDT timer. These times differ in function but all of them have the block shown in Figure 7.1 in common.
where, - S: is the Set (Trigger) signal of the timer. - TV: is the time value stored in the timer which must be in the form (S5T#tv). The maximum time value for tv that you can enter is 9,990 seconds, or 2H_46M_30S. - R: is the Reset signal of the timer. - Q: is the output of the timer. - BI: is the current time* in binary code. - BCD: is the current time* in binary coded decimal code. - Timer number: this can be in the form (T#), where # can be any number in the range (0-255), since Siemens S7-300 PLC allows the use of 256 timers at max. - Timer type: is one of the 5 timer types mentioned above.
* The current time value is the initial TV value minus the time elapsed since the timer was started. 0405462: Automation Laboratory
67
Session 7 The following are examples on how to write the time tv in its correct form: S5TIME#4S = 4 seconds S5T#2h_15m = 2 hours and 15 minutes S5T#1H_12M_18S = 1 hour, 12 minutes, and 18 seconds
Timers
The following five sections will discuss each timer type individually.
The timer is reset when the timer reset (R) input changes from "0" to "1" while the timer is running. The current time and the time base are also set to zero. Logic "1" at the timer's R input has no effect if the timer is not running.
68
Session 7
Timers
The timer is reset if the reset (R) input changes from "0" to "1" while the timer is running. The current time and the time base are set to zero.
The timer is reset if the reset (R) input changes from "0" to "1" while the timer is running. The current time and the time base are set to zero. The signal state at output Q is then "0". The timer is also reset if there is a logic "1" at the R input while the timer is not running and the RLO at input S is "1".
69
Session 7
Timers
input S. The timer will be restarted (re-triggered) with the specified time if the signal state at input S changes from "0" to "1" while the timer is running.
The timer is reset if the reset (R) input changes from "0" to "1" without regard to the RLO at the S input. The signal state at output Q is then "0".
The timer is reset when the reset (R) input changes from "0" to "1" while the timer is running.
70
Session 7
Timers
7.6 Examples
Example 7.1: If "Start" push button is pressed, the conveyor belt will be activated for 4 sec or till "Stop" push button is pressed. It is obvious from the question that the conveyor belt will start immediately once "Start" is pressed, which mean that there is no delay. Then the proper timer for this type of question is S_PULSE or S_PEXT timers. 0405462: Automation Laboratory
71
Timers
According to the timing diagram shown in Figure 7.7, S_PULSE timer needs the set signal to be maintained for at least t=tv if the time tv is to elapse completely, hence the need for the latch. Once "Stop" is pressed or the 4 sec are over the timer will turn off so will the conveyor belt.
Using S_PEXT timer: This type does not require a latch, then even if "Stop" is placed in series with "Start", it will has no effect. The solution then is to use "stop" as a reset signal but since "Stop" is a normally closed push button a normally close contact is used from it to ensure that no current exist at the reset terminal until "Stop" is pressed.
Example 7.2: If "Start" push button is pressed, the conveyor belt will wait 4sec then get activated till "Stop" push button is pressed. The obvious from the question is that there is a delay time between the press of "Start" and the operation of the conveyor belt. So obviously, an ON delay timer is needed. But there are two types of ON delay timers: S_ODT and S_ODTS. 0405462: Automation Laboratory
72
Timers
The above two methods are obvious solution for this type of question. But we can manipulate the S_PULSE and S_PEXT timers to obtain the same result as follows:
Using S_PULSE timer: The ladder diagram to solve this example using S_PULSE timer is shown in Figure 7.12. As shown in the diagram, once "Start" is pressed and since "Stop" is a normally closed push button, the internal coil "M0.0" will get activated. Consequently, the timer T1 will start timing. Once the 4 sec are over, the normally closed contact in the last rung will get back to its normally closed state and since the contact "M0.0" is closed now, current will flow through "Q0.0" activating the conveyor belt. 0405462: Automation Laboratory
73
Session 7
Timers
Using S_PEXT timer: The ladder diagram to solve this example using S_PEXT timer is shown in Figure 7.13. Here we "Start" directly at the set signal of the timer, since S_PEXT timer does not need latch. But even the use of "M0.0" here will be valid.
74
Timers
If "Start" push button is pressed, the conveyor belt will be activated. If "Stop" push button is pressed, the conveyor belt will wait 4 seconds then stop. In this question the conveyor belt will start immediately when "Start" push button is pressed but will start timing once "Stop" is pressed. This leads to an off delay timer or S_OFFDT. The ladder diagram required to solve this question is shown in Figure 7.14.
75