0% found this document useful (0 votes)
30 views51 pages

Chapter 4.3 Programming Counters - A - Siemens

Uploaded by

Nguyen Pham Khoi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views51 pages

Chapter 4.3 Programming Counters - A - Siemens

Uploaded by

Nguyen Pham Khoi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Chapter 4

PLC
Programming

Copyright (c) 2017 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education
Section 4.6

Counter Instructions
Section 4.6.1

Counter Instructions
Programmed
counters serve the
same function as
mechanical counters.

Every time the actuating lever is moved over, the


counter adds one number.

Resetting to zero is done with a pushbutton located


on the side of the unit.
Electronic counters
can count up, count
down, or be
combined to count
up and down.
Source: Photo courtesy Omron Industrial
Automation, www.ia.omron.com.

Although the majority of counters used in industry


are up-counters, numerous applications require the
implementation of down-counters or of
combination up/down-counters.
All PLC manufacturers offer some form of
counter instruction.

One common counter application is keeping track of


the number of items moving past a given point.
PLC counter instructions are similar to timers
except that they do not operate on an internal
clock but are dependent on external or
program sources for counting
PLC counter instructions
PLC counter instructions
Generic block-formatted counter.

All PLC counters operate, or count, on the leading


edge or off-to-on transition of the input condition.
PLC counters can be programmed to count up to
a preset value or to count down to a preset value.
The up-counter is incremented by
1 each time the rung containing
the counter is energized.

The down-counter decrements by


1 each time the rung containing
the counter is energized.
Section 4.6.2

Up-Counter
The up-counter is used to count false-to-true
transitions of an input instruction and then
trigger an event after a required number of
counts or transitions.

The up-counter output instruction will


increment its accumulated value by 1 each
time the counted event occurs.
SLC 500 Up-Counter program
SLC 500 Up-Counter timing diagram
Simulated Up-Counter program
Up-counter instruction.

The CTU counter counts up by 1 when the value of


parameter CU changes from 0 to 1.
- If the value of parameter CV (current count value) is
greater than or equal to the value of parameter PV (preset
count value), then the counter output parameter Q = 1.
- If the value of the reset parameter R changes from 0 to 1,
then the current count value is reset to 0.
Up-counter instruction.

MW0=4
PLC counter program
Simulated counter program used to stop a motor
Can-counting program
Simulated can-counting program.
The off-to-on transitional
contact provides a one-
shot pulse when the
trigger signal makes a
off-to-on transition.

The on-to-off transitional


contact provides a one-
shot pulse when the
trigger signal makes a
on-to-off transition.
Section 4.6.3

Down-Counter
A down-counter will count down or decrement
by 1 each time the counted event occurs.
Count-down Counter Instruction

The CTD counter counts down by 1 when the value of


parameter CD changes from 0 to 1.
- If the value of parameter CV (current count value) is
equal to or less than 0, the counter output parameter Q =
1.
- If the value of parameter LOAD changes from 0 to 1,
the value at parameter PV (preset value) is loaded to the
counter as the new CV (current count value).
Count-down Counter Instruction

MW2=3
Count-down Counter Instruction Program
Continuous monitoring of items in process.

The accumulated count of


the counter continuously
indicates the number of
in-process parts.
Program that provides continuous
monitoring of items in process.
Simulated program that provides
continuous monitoring of items in process.
Section 4.6.4

Up/Down
Counter
Up-down Counter Instruction
Up-down Counter Instruction
The CTUD counter counts up or down by 1 on the 0 to 1
transition of the count up (CU) or count down (CD)
inputs.
- If the value of parameter CV is equal to or greater than
the value of parameter PV, then the counter output
parameter QU = 1.
- If the value of parameter CV is less than or equal to
zero, then the counter output parameter QD = 1.
- If the value of parameter LOAD changes from 0 to 1,
then the value at parameter PV is loaded to the counter
as the new CV.
- If the value of the reset parameter R is changes from
0 to 1, the current count value is reset to 0.
Count-down Counter Instruction

MW4=4
Type shown in Counter Instruction
Section 4.6.5

Cascading Counters
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 count
is by interconnecting, or
cascading, two counters. Source: Photo courtesy Omron Industrial
Automation, www.ia.omron.com.
Counting beyond the maximum count program.
Simulated counting beyond the maximum
count program.
Cascading counters for extremely large counts.
Simulated program for extremely large counts.
Section 4.6.6

Combining
Counter and Timer
Functions
Automatic
stacking
program
Motor
lock-out
program

Source: This material and associated


copyrights are proprietary to, and used
with the permission of Schneider
Electric.
Product flow rate program.

Source: Photo courtesy Omron Industrial


Automation, www.ia.omron.com.
Timer driving a counter to produce an
extremely long time-delay period.
Section 4.6.7

Compare
Instructions

You might also like