Cnt, Cdp, And Cud (Counter) - IDEC MICROSmart FC6A Series Ladder Programming Manual

Automation organizer windldr
Hide thumbs Also See for MICROSmart FC6A Series:
Table of Contents

Advertisement

4: B
I
ASIC
NSTRUCTIONS

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 512 counters can be programmed in a user program. Each counter must be allocated to a unique
number C0 through C511.
Counter
CNT (adding counter)
CDP (dual-pulse reversible counter)
CUD (up/down selection reversible counter)
For details about device ranges, see "Device Addresses" on page 2-1.
To indirectly specify the value, specify it with a data register number, and specify the value of the data register in the range of 0 to 65,535.
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 C511, followed
by a counter preset value from 0 to 65,535.
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.
Ladder Diagram
Reset
CNT
C0
5
I0
Pulse
I1
I2
C0
Q0
• The CNT instruction cannot be used in an interrupt program.
• When the reset input is on, all pulse inputs are ignored.
• While the reset input is off, the counter counts the leading edges of pulse inputs and compares them with the preset value.
• When the reset input changes from off to on, the current value is reset.
• When the current value reaches the preset value, the counter turns output on. The output stays on until the reset input is turned on.
Note: Certain instructions can be programmed in a series after a counter instruction in WindLDR. These instructions are not automatically
connected to the right power rail as shown in the above ladder diagram. (Refer to the below diagram.)
For details, see "Counter Circuit" on page 4-15.
R
CNT C000
5
I0000
P
I0001
I0002
C000
Timing Chart
ON
Reset Input I0
OFF
ON
Pulse Input I1
OFF
ON
Counter C0
OFF
ON
Input I2
OFF
ON
Output Q0
OFF
4-12
Program List
Instruction
Data
LOD
I0
LOD
I1
CNT
C0
5
LOD
I2
AND
C0
OUT
Q0
1
2
3
4
5
6
• • •
FC6A S
MICROS
L
ERIES
MART
Device Address
C0 to C511
C0 to C511
C0 to C511
Q0000
P
M
ADDER
ROGRAMMING
ANUAL
Preset Value
Constant:
0 to 65,535
Data registers:
D0 to D7999
D10000 to D61999
FC9Y-B1726

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents