Programmable Logic Controllers: Counters (Cont'd)
Programmable Logic Controllers: Counters (Cont'd)
Logic Controllers
Counters (cont’d)
Example 1
An Alarm Monitor
Program
An Alarm Monitor Program
The light will operate in the steady mode when the alarm
trigger condition exists but has been acknowledged (reset).
Down-Counter
The down-counter output instruction will count down
or decrement by 1 each time the counted event occurs.
Each time the down-count event occurs, the
accumulated value is decremented. Normally the down-
counter is used in conjunction with the up counter to
form an up/down counter.
Generic up/down
counter program
Up/Down Counter Timing diagram
Preset Value = 3
Example 2
A Parking Garage
Counter Program
A Parking Garage Counter Program
After processing,
Before start-up, finished
the systemparts appearing empty
is completely at the out-feed
of parts, sensor
and
When the
generate operation
down begins, raw parts move through the in-feed
the counter is counts, so the accumulated
reset manually to zero. count of the counter
sensor, with each
continuously part generating
indicates the numberan of up count. parts.
in-process
Counter Speed
Depending on the
application, it may be
necessary to count events
that exceed the maximum
number allowable per
counter instruction. One way
of accomplishing this is by
interconnection, or
cascading, two counters.
Example 5
A 24 Hour Clock
Program
Example 6
An Incremental
Encoder
An Incremental Encoder
An incremental encoder creates a
series of square waves as its shaft
is rotated.
The encoder disk interrupts the light
as the encoder shaft is rotated to
produce the square wave output
waveform.
Incremental Encoder