26.10.2012 Views

Statement List (STL) - DCE FEL ČVUT v Praze

Statement List (STL) - DCE FEL ČVUT v Praze

Statement List (STL) - DCE FEL ČVUT v Praze

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

B.3 Example: Timer Instructions<br />

Clock Pulse Generator<br />

Programming Examples<br />

You can use a clock pulse generator or flasher relay when you need to produce a<br />

signal that repeats periodically. A clock pulse generator is common in a signalling<br />

system that controls the flashing of indicator lamps.<br />

When you use the S7-300, you can implement the clock pulse generator function by<br />

using time-driven processing in special organization blocks. The example shown in<br />

the following statement list, however, illustrates the use of timer functions to<br />

generate a clock pulse. The sample program shows how to implement a<br />

freewheeling clock pulse generator by using a timer.<br />

<strong>Statement</strong> <strong>List</strong> to Generate a Clock Pulse (pulse duty factor 1:1)<br />

<strong>STL</strong> Explanation<br />

U T1 //If timer T 1 has expired,<br />

L S5T#250ms //load the time value 250 ms into T 1 and<br />

SV T1 //start T 1 as an extended-pulse timer.<br />

NOT //Negate (invert) the result of logic operation.<br />

BEB //If the timer is running, end the current block.<br />

L MB100 //If the timer has expired, load the contents of memory byte MB100,<br />

INC 1 //increment the contents by 1,<br />

T MB100 //and transfer the result to memory byte MB100.<br />

Signal Check<br />

A signal check of timer T1 produces the following result of logic operation (RLO).<br />

1<br />

0<br />

250 ms<br />

As soon as the time runs out, the timer is restarted. Because of this, the signal check<br />

made the statement AN T1 produces a signal state of 1 only briefly.<br />

<strong>Statement</strong> <strong>List</strong> (<strong>STL</strong>) for S7-300 and S7-400 Programming<br />

A5E00706960-01 B-7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!