![IDEC OpenNet series User Manual Download Page 124](http://html.mh-extra.com/html/idec/opennet-series/opennet-series_user-manual_617384124.webp)
7: B
ASIC
I
NSTRUCTIONS
O
PEN
N
ET
C
ONTROLLER
U
SER
’
S
M
ANUAL
7-11
CNT, CDP, and CUD (Counter)
Three types of counters are available; adding (up) counter CNT, dual-pulse reversible counter CDP, and up/down selection
reversible counter CUD. A total of 256 counters can be programmed in a user program. Each counter must be allocated to
a unique number C0 through C255.
CNT (Adding Counter)
When counter instructions are programmed, two addresses are required. The circuit for an adding (UP) counter must be
programmed in the following order: reset input, pulse input, the CNT instruction, and a counter number C0 through C255,
followed by a counter preset value from 0 to 65535.
The preset value can be designated using a decimal constant or a data register. When a data register is used, the data of the
data register becomes the preset value.
Counter
Allocation Number
Preset Value
CNT (adding counter)
C0 to C255
Constant: 0 to 65535
Data registers: D0 to D7999
CDP (dual-pulse reversible counter)
C0 to C255
CUD (up/down selection reversible counter)
C0 to C255
Ladder Diagram
Rung 1
I2
Reset Input I0
ON
OFF
Pulse Input I1
ON
OFF
Counter C0
ON
OFF
Timing Chart
Output Q0
ON
OFF
1
Input I2
• • •
C0
2
3
4
5
ON
OFF
CNT
C0
5
I1
Reset
Pulse
Prgm Adrs
Instruction
Data
Rung 1
0
1
2
3
LOD
LOD
CNT
I0
I1
C0
5
Rung 2
4
5
6
LOD
AND
OUT
I2
C0
Q0
Program List
Rung 2
I0
•
The same counter number cannot be
programmed more than once.
•
While the reset input is off, the
counter counts the leading edges of
pulse inputs and compares them with
the preset value.
•
When the current value reaches the
preset value, the counter turns output
on. The output stays on until the reset
input is turned on.
•
When the reset input changes from
off to on, the current value is reset.
•
When the reset input is on, all pulse
inputs are ignored.
•
The reset input must be turned off
before counting may begin.
•
When power is off, the counter’s cur-
rent value is held, and can also be
designated as “clear” type counters
using Function Area Settings (see
page 5-3).
•
Counter preset and current values
can be changed using
WindLDR
with-
out transferring the entire program to
the CPU (see page 7-12).
•
When the preset or current value is
changed during counter operation,
the change becomes effective imme-
diately.
•
The preset value 0 through 65535 can
be designated using a data register D0
through D7999, then the data of the
data register becomes the preset value.
Directly after the CNT instruction, the
OUT, OUTN, SET, RST, TML, TIM,
TMH, or TMS instruction can be pro-
grammed.
Ladder Diagram
CNT
C28
D5
I1
Reset
Pulse
I0
Q0
Caution
• When using
WindLDR Ver. 3
, any instruction cannot be
programmed immediately above and below the CNT
instruction. To program other instructions, start a new
rung. If an instruction is entered above or below the
CNT instruction in the same rung, the program is not
compiled correctly.
Q0
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]