![Omron CJ1W-CTL41-E Operation Manuals Download Page 53](http://html1.mh-extra.com/html/omron/cj1w-ctl41-e/cj1w-ctl41-e_operation-manuals_741969053.webp)
Controlling a Counter
Section 3-4
36
3-4
Controlling a Counter
Each Counter Input contains a gate through which the counting function can be
enabled or disabled. When disabled, the gate will block incoming counter signals.
The Gate of a Counter can be enabled and disabled by using the “Open Gate Bit”
and “Close Gate Bit” in CIO.
Note
Initially, at power up or restart of the Unit, for both counter types (i.e. Circular-, and
Linear Counters) the Gate is closed and counting is disabled. In order to enable
counting you must open the Gate first.
Preset Function
The Unit is equipped with a Preset Register for every Counter that contains the
Preset Value. To change the Preset Value you can change the (32-bits) Preset
Value in CIO of the corresponding Counter. The Counter Value is overwritten with
the Preset Value at a rising edge of the Preset Counter Bit of the corresponding
Counter.
Reset Function
To reset a Counter, through a signal pulse on the corresponding Z-input, the Z-
input Reset Enable bit must be set to 1. A Counter can also be reset by using the
“Software Reset Bit” in CIO. Setting this bit to ‘1’ causes a forced reset of the cor-
responding Counter. Refer to section Section 3-6
for detailed infor-
mation about resetting Counters.
CNT3
CNT4:
n+7
n+10
Open Gate:
0
→
1 = Open Gate
Close Gate:
0
→
1 = Close Gate
CNT1:
CNT2:
n+1
n+4
15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
A rising edge of the "Open Gate Bit" opens the Gate regardless of the state of the "Close Gate
Bit". A rising edge of the "Close Gate Bit" closes the Gate regardless of the state of the "Open
Gate Bit". At a simultaneous rising edge of both bits, the state of the Gate is unchanged.
Preset Counter:
0
→
1 = Preset Counter
CNT3
CNT4:
n+7
n+10
CNT1:
CNT2:
n+1
n+4
15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0
CNT3:
CNT4:
n+8
n+11
n+9
n+12
Preset Value
Set between 00000000
H
and FFFFFFFF
H
(Circular Counter)
Set between 80000000
H
and 7FFFFFFF
H
(Linear Counter)
CNT1:
CNT2:
n+2
n+5
n+3
n+6
15 14 13 12 11 10 9
8
7
6
5
4
3
2
1
0