
3-9
3 Operation and Configuration
CJ-series High-speed Counter Units Operation Manual for NJ-series CPU Unit(W492)
3-2 Co
unter T
yp
es
3
3-2-1 Simple Counter
z
Gating of a Simple Counter
You can start or stop the gate of a Simple Counter by using the following device variables for CJ-
series Unit (for output) (Open Gate, Close Gate). A rising edge of the Open Gate or Close Gate trig-
gers the corresponding action in the next I/O refresh.
* The system enters the count start state at the rising edge of the Open Gate regardless of the Close Gate state.
At a simultaneous rising edge of both variables, the state of the gate is unchanged.
A Simple Counter is stopped when the Unit is restarted or the Controller is reset, including when the
power is turned ON. So in order to start a count, it is necessary to first change the open gate (start)
to 1.
z
Presetting a Simple Counter
The Unit has device variables for CJ-series Unit (for output) which are used to save preset values
for Simple Counters. To change preset values, set values to these variables. The rising edge of the
preset is the trigger and the Counter Value is overwritten by the preset value at the next I/O refresh.
z
Resetting a Simple Counter
A Counter can be reset by using a Simple Counter reset. The rising edge of the reset is the trigger
and the Counter is reset at the next I/O refresh.
z
Digital Inputs Status of Simple Counter
The status of the two Digital Inputs is reflected in the devices variables for CJ-series Unit (for input).
Name of device variable
for CJ-series Unit
Type
Name
Function
*_Ch1_Enbl
BOOL
Open Gate
0 to 1: Count start*
*_Ch2_Enbl
*_Ch1_Dsbl
BOOL
Close Gate
0 to 1: Count stop
*_Ch2_Dsbl
Name of device variable
for CJ-series Unit
Type
Name
Function
*_Ch1_Prst
BOOL
Preset
0 to 1: Counter preset
*_Ch2_Prst
*_Ch1_PrstLinCtVal
DINT
Preset Value
Used for a Simple Counter or Linear
Counter.
Set in the range
−
2,147,483,648 to
2,147,483,647.
*_Ch2_PrstLinCtVal
Name of device variable
for CJ-series Unit
Type
Name
Function
*_Ch1_Rst
BOOL
Reset
0 to 1: Counter reset
*_Ch2_Rst
Name of device variable
for CJ-series Unit
Type
Name
Function
*_In0
BOOL
Digital Input 0 Status
0: OFF
1: ON
*_In1
BOOL
Digital Input 1 Status
0: OFF
1: ON