Chapter 4.3 Programming Counters - A - Siemens
Chapter 4.3 Programming Counters - A - Siemens
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.
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.
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.
Down-Counter
A down-counter will count down or decrement
by 1 each time the counted event occurs.
Count-down Counter Instruction
MW2=3
Count-down Counter Instruction Program
Continuous monitoring of items in process.
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
Compare
Instructions