Cnt, Cdp, And Cud (Counter) - IDEC FC4A-C10R2 User Manual

Fc4a series microsmart micro programmable logic controller
Table of Contents

Advertisement

7: 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 32 counters (all-in-one 10-I/O type CPU module) or 100 counters (other CPU modules)
can be programmed in a user program. Each counter must be allocated to a unique number C0 through C31 or C99.
Counter
CNT (adding counter)
CDP (dual-pulse reversible counter)
CUD (up/down selection reversible counter)
The valid operand range depends on the CPU module type. For details, see pages 6-1 and 6-2.
The preset value can be 0 through 65535 and designated using a decimal constant or data register.
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 C99,
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.
Ladder Diagram
Reset
CNT
C0
5
I0
Pulse
I1
I2
C0
Q0
Timing Chart
ON
Reset Input I0
OFF
ON
Pulse Input I1
OFF
ON
Counter C0
OFF
ON
Input I2
OFF
ON
Output Q0
OFF
• The preset value 0 through 65535 can be designated
using a data register D0 through D1299 or D2000
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 programmed.
Reset
CNT
D5
I0
Pulse
I1
7-10
Program List
Instruction
Data
LOD
I0
LOD
I1
CNT
C0
5
LOD
I2
AND
C0
OUT
Q0
1
2
3
4
5
6
• • •
C28
Q0
« FC4A M
ICRO
Allocation Number
C0 to C99
C0 to C99
C0 to C99
• The same counter number cannot be programmed
more than once.
• While the reset input is off, the counter counts the lead-
ing 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 cur-
rent 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 current value is held,
and can also be designated as "clear" type counters
using Function Area Settings (see page 5-4).
• Counter preset and current values can be changed
using
WindLDR
gram to the CPU again. From the
select Online > Monitor, then select Online > Point
Write. To change a counter preset value, specify the
counter number with a capital C and a new preset
value. To change a counter current value, specify the
counter number with a small c and a new current value
while the counter reset input is off.
• When the preset or current value is changed during
counter operation, the change becomes effective imme-
diately.
• For the data movement when changing, confirming,
and clearing preset values, see page 7-13. Preset values
can also be changed and changed preset values can be
confirmed using the HMI module. See pages 5-35 and
5-36.
S
U
'
M
»
MART
SER
S
ANUAL
Preset Value
Constant:
0 to 65535
Data registers: D0 to D1299
D2000 to D7999
without downloading the entire pro-
WindLDR
menu bar,

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents