Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(EOD).Mechatronics.pdf
Скачиваний:
81
Добавлен:
23.08.2013
Размер:
5.07 Mб
Скачать

page 290

Alternate between two outputs continuously using latches. ie, each scan one will turn off and the other will turn on.

22.2.2 Flip-Flops

• There are many type, but one of the best known is the SR (Set-Reset) Flip-Flop.

page 291

S Q

R Q

S

R

Q

Q

Some PLCs use Flip-Flops instead of latches. (not in A-B PLCs)

22.2.3 Timers

• We use timers to do some or all of, - Delay turning on

- Delay turning off

- Accumulate time passed

 

on-delay

off-delay

 

 

 

Retentive

RTO

RTF

 

 

 

Nonretentive

TON

TOF

 

 

 

page 292

e.g. An On Timer (TON)

 

 

 

 

TON

 

 

 

A

 

 

Timer T4:0

 

(DN)

 

 

 

 

 

 

 

 

 

 

 

 

 

Time Base 1.0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Preset 4

 

(EN)

 

 

 

 

 

 

 

 

 

Accum. 0

 

 

 

 

 

 

 

 

 

 

 

 

 

A

 

 

 

 

 

 

 

T4:0 EN

 

 

 

 

 

 

 

T4:0 DN

 

 

 

 

 

 

 

 

 

3

 

4

 

 

2

 

 

 

 

 

 

T4:0 Accum.

0

 

 

 

 

 

 

 

 

 

 

 

 

 

0

3

6

9

13

14

17

19

page 293

e.g. A Retentive On Timer (RTO)

 

 

 

 

RTO

 

 

 

A

 

 

Timer T4:0

 

(DN)

 

 

 

 

 

 

 

 

 

 

 

 

 

Time Base 1.0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Preset 4

 

(EN)

 

 

 

 

 

 

 

 

 

Accum. 0

 

 

 

 

 

 

 

 

 

 

 

 

 

A

 

 

 

 

 

 

 

T4:0 EN

 

 

 

 

 

 

 

T4:0 DN

 

 

 

 

 

 

 

 

 

3

4

 

 

 

 

 

 

 

 

 

 

 

T4:0 Accum.

0

 

 

 

 

 

 

 

 

 

 

 

 

 

0

3

6

9

10

14

17

19

page 294

e.g. An Off Timer (TOF)

 

 

 

 

TOF

 

 

 

A

 

 

Timer T4:0

 

(DN)

 

 

 

 

 

 

 

 

 

 

 

 

 

Time Base 0.01

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Preset 350

 

(EN)

 

 

 

 

 

 

 

 

 

Accum. 0

 

 

 

 

 

 

 

 

 

 

 

 

 

A

 

 

 

 

 

 

 

T4:0 EN

 

 

 

 

 

 

 

T4:0 DN

 

 

 

 

 

 

 

 

3

 

3.5

 

 

 

 

 

 

 

 

 

 

 

T4:0 Accum.

0

 

 

 

 

 

 

 

 

 

 

 

 

 

0

3

6

9.5

10

16

18

20

e.g. A Retentive Off Timer (RTF)

A

A

T4:0 EN

T4:0 DN

page 295

RTF

 

 

Timer T4:0

 

(DN)

Time Base 0.01

 

 

 

 

Preset 350

 

(EN)

Accum. 0

 

 

 

 

 

T4:0 Accum.

0

3

6

10

16

18

20

When using timers (especially retentive) we must reset values when done. The (RES) instruction does this.

The timers also have timer timing bits that indicate when the accumulator value is changing.

Consider the example below, Write out the values for the accumulator, enable, timer timing and the done bits.

page 296

e.g. An Allen-Bradley PLC-5 Retentive Timer ON

 

 

 

 

RTO

 

 

 

A

 

 

Timer T4:0

 

(DN)

 

 

 

 

 

 

 

 

 

 

 

 

 

Time Base 1.0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Preset 10

 

(EN)

 

 

 

 

 

 

 

 

 

Accum. 1

 

 

 

 

 

 

 

 

 

 

 

 

 

A

T4:0 EN

T4:0 TT

T4:0 DN

T4:0 Accum.

0

3

6

9

14

17

18

20

SLC 150

 

 

A

 

901

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RTO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PR 0100

 

 

 

 

 

 

 

 

 

 

 

 

 

• Repeat the last example for the timer below.

page 297

e.g. An Allen-Bradley PLC-5 Timer Off Delay

 

 

 

 

TOF

 

 

 

A

 

 

Timer T4:1

 

(EN)

 

 

 

 

 

 

 

 

 

 

 

 

 

Time Base .01

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Preset 50

 

(DN)

 

 

 

 

 

 

 

 

 

Accum. 0

 

 

 

 

 

 

 

 

 

 

 

 

 

A

T4:1 EN

T4:1 TT

T4:1 DN

T4:1 Accum.

0

15

45

 

150

200

225

SLC 150

 

 

 

902

 

 

 

 

 

 

A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TOF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PR 0050

 

 

 

 

 

 

 

 

 

 

• Consider the example of the SLC timers given below,

 

 

 

001

001

001

001

901

002

002

002

002

page 298

901

TON

PR 0040

902

RTO

PR 0040

903

TOF

PR 0040

904

RTF

PR 0040

011

901

RST

902

RST

903

RST

904

RST

page 299

001

002

901

902

903

904

011

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

time

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

5

 

 

 

10

 

 

 

 

15

 

 

20

 

 

 

25

 

 

 

30

 

 

 

35

 

 

 

40

 

 

 

 

(sec)

• As an example,

write a short ladder logic program that will turn a light (LA) on 10 seconds after a button (PB) is pushed. A second light (LB) should be on while the button is pushed and then turn off 10 seconds after it has been released.

Соседние файлы в предмете Электротехника