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

page 286

22. EVENT BASED LOGIC

• These devices will be set based on previous conditions in the PLC.

22.1 INTRODUCTION

Typical events in a PLC include,

-first scan of the PLC

-time since an input turned on/off

-count of events

-etc.

22.2 TIMERS, COUNTERS, FLIP-FLOPS, LATCHES

• There are some devices, and concepts that are Temporal. This means that they keep track of events over time, as opposed to conditional logic that decides based on instantaneous conditions.

e.g. A Start Push Button

Push Button

+V

Device

On/Off

 

Push Button

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Device

 

 

(Conditional Control)

 

 

 

 

 

 

 

 

Device

 

 

(Event Control)

 

 

 

 

 

 

 

 

 

 

 

 

 

time

 

 

 

 

 

Controls that have states, or time dependence will require temporal controls (also known as sequential)

Some devices that are temporal are

Flip-Flops - these can be latched on or off.

page 287

Latches - Will stay on until reset (Similar to flip-flops) Counters - Keeps a count of events

Timers - Allows inputs and outputs to be delayed, or prolonged be a known amount.

22.2.1 Latches

- Will stay on when set, until unlatched (even through power loss)

A D

L

A C

B D

U

page 288

Timing Diagram

event too short to be noticed (aliasing)

A

B

C

D

These lines indicate PLC input/output refresh times. At this time all of the outputs are updated, and all of the inputs are read. Notice that some inputs can be ignored if at the wrong time,

and there can be a delay between a change in input, and a change in output.

The space between the lines is the scan time for the ladder logic. The spaces may vary if different parts of the ladder diagram are executed each time through the ladder (as with state space code). The space is a function of the speed of the PLC, and the number of Ladder logic elements in the program.

• Assuming that the PLC is much faster than the fastest event (i.e. no aliasing), then we can approximate the timing diagram above with a simpler form.

A

B

C

D

 

 

 

page 289

 

 

• As an example consider the ladder logic for a SLC-150,

 

 

 

 

 

011

 

002

 

 

 

 

 

 

 

 

 

 

 

 

002

 

 

012

 

 

 

 

 

 

 

 

L

 

 

 

 

 

 

003

 

 

012

 

 

 

 

 

 

 

 

U

 

 

 

 

 

 

002

 

 

013

 

 

 

 

 

 

 

 

 

 

 

 

 

003

 

 

013

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

002

003

011

012

013

In most PLCs these will keep their last state even when the PLC is turned off, and back on.

Write a short ladder logic program that will,

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