Sunteți pe pagina 1din 36

IE 262

Programmable Logic Controllers and


PLC Programming
PLC System
Ladder Diagram

input output
Example 1

Example 2
Sensor
Sensor

Output
accumulated value
The number of time units or counts that have accrued. When the accumulated value
equals the preset value, the done bit is enabled..
done bit
A bit that ends the time delay or counter count when the accumulated value is equal
to the preset value. The done bit is one of the most frequently used status bits.
preset value
A value set in advance that triggers a timer or counter action. When the accumulated
value equals the preset value, the done bit is enabled.
enable bit
A bit that begins timer timing when the bit is true (1). The enable bit is one of the
most frequently used status bits.
PLC timer
A control device that automatically starts or stops machines and other devices when
a preset time period has been exceeded. PLC timers do not exist in the real world,
but rather as a set of instructions inside the PLC microprocessor.
PLC counter
A device that counts, calculates, or keeps a record of the number of times something
happens. PLC counters do not exist in the real world, but rather as a set of instructions
inside the PLC microprocessor.
PLC TIMERS PERFORMS VARIOUS FUNCTIONS

• They delay an action


• They cause an operation to run a predetermined period of time
• They record the total accumulated time of continuous or intermidiate events

ACTIVATING A TIMER
• A timer is activated by a change in the logic continuity of its rung
TON
T4:2/EN T4:3/EN T4:1/DN
T4:1 EN
1 Pre:30
Acc:0 DN

T4:1/EN O:2/0
2 RED

T4:1/EN T4:3/EN T4:2/DN TON


T4:2 EN
3 Pre:10
Acc:0 DN

T4:2/EN O:2/1

YELLOW

TON
T4:1/EN T4:2/EN T4:3/DN EN
T4:3
5 Pre:20
Acc:0 DN

T4:3/EN O:2/2

6 GREEN

7 END
An ON-delay timer is enabled when its rung is true. A rung is true
when there is at least one path made by the instructions that are true
from the left rail to the timer instruction.
An OFF-delay timer is enabled when its rung is false. When a timer is
enabled, its Accumulate value shows how many Time Base intervals
have elapsed since the timer was activated.
A timer is done when its Accumulate value reaches its Preset value.
When an ON-delay timer or an OFF-delay timer is timing, its rung
condition change, i.e. a rung changes from true to false for an ON-
delay timer or a rung changes from false to true for an OFF-delay
timer, will cause the timer to stop and its Accumulate value to be
reset to zero.
Each timer instruction has three very useful status bits. These bits are Timer Enable (TE), Timer Timing
(TT) and Timer Done (TN). Each of these bits has one bit of memory and the memory is affected by the
corresponding bit status. For an ON-delay timer and a retentive timer,

•The Timer Enable bit is high when the timer’s rung is true; it is low when the rung is false.

•The Timer Timing bit is high when the timer’s rung is true and the Accumulate value is less than the Preset
value. This bit is low when the rung is false or after the Accumulate value equals the Preset value.

•The Timer Done bit is high when the rung is true and the timer is done. It is low when the rung is false or
before the timer is done.

For an OFF-delay timer,

•The Timer Enable bit is high when the timer’s rung is false; it is low when the rung is true.

•The Timer Timing bit is high when the timer’s rung is false and the Accumulate value is less than the
Preset value. This bit is low when the rung is true or after the Accumulate value equals the Preset value.

•The Timer Done bit is high when the rung is false and the timer is done. It is low when the rung is true or
before the timer is done.
I:1/0

B:3/0
I:1/1

B:3/0
TON
EN
B:3/0 T4:0
DN

T4:0/EN O:2/0

T4:0/TT O:2/1

T4:0/DN O:2/2
PLC COUNTER INSTRUCTIONS

• Counters are output instructions that are internal to a PLC

• Counters simply count and store the number of events that occur

• The two common type of counters are up-counters and down-counters

• Up-counters increment and down counters decrement each time the


counter’s rung goes from FALSE to TRUE
I:1/0 CU
DN

CD
I:1/2
DN

C5:1
I:1/1 RES

O:2/0
C5:1/CU

O:2/1
C5:1/CD

C5:1/DN O:2/2
Example:1

When the start pushbutton is pressed, the red pilot light turns on and the conveyor
starts running. Light bulbs travel along a conveyor and when the 6th light bulb is
sensed via proximity sensor, the conveyor stops. An operator picks up the light bulbs
and restarts the machine by pressing Start button. Pressing Stop shuts down the
whole process.
START
I: 1/0 STOP
I: 1/1 B3:O
1

B3:O (internal bit)

B3:O O:2/0
2 Red Pilot

B3:O C5:1/DN O:2/1 If START is pressed and


3 Conveyor counter preset is not
CTU equal to 6
I:1/2 O:2/1 DN:Done bit. Becomes
C5:1 CU Count Up TRUE (1) when
Preset:6
Accumulator value is
Acc. DN equal to preset value.
I:1/1 FALSE(0) otherwise.
5 Reset the counter
RESET if/when STOP is
C5:1 pressed

C5:1/DN
6 END
Example:2
I: 1/0
I: 1/1 B3:O
1

B3:O

B3:O C5:1/DN O:2/0


2

O:2/1

T4:1/DN
CTU
I:1/5 O:2/1 C5:1 CU
3 Preset:6
Acc. DN
I:1/1

RESET
C5:1

T4:1/DN
T4:1
C5:1/DN TCN EN
5 P:5 sec
DN

6 END

S-ar putea să vă placă și