X20 system modules • Counter modules • X20DC2395
X20 system User's Manual 3.10
817
Configure counter mode
Name:
Counter function 1: CfO_Counter1config
Counter function 2: CfO_Counter2config
These registers are used to configure the mode of the counter function. Each counter function can be operated
in 3 different modes.
Counter function mode
Edge counters
AB encoder
Up/down counter
Counter channel 1
1)
Counting pulses, edge counter 1
A
Metering pulses
Counter channel 2
1)
Counting pulses, edge counter 2
B
Counting direction (0 =
positive, 1 = negative)
Counter register 1
Counter value 1
Position
Counter value
Counter register 2
Counter value 2
1)
Data type
Value
USINT
See bit structure.
Bit structure:
Bit
Description
Value
Information
00
Edge counters
01
AB encoder
0 - 1
Counter mode
11
Up/down counter
2 - 7
Reserved
-
Configure calculation of internal counters
Name:
Counter function 1: CfO_Counter1configReg0 to CfO_Counter2configReg0
Counter function 2: CfO_Counter1configReg1 to CfO_Counter2configReg1
The calculation of the internal "counter1" and "counter2" registers can be configured in these registers. For infor-
mation on using these internal registers, see 4.11.14.12.6.1 "Counter value calculation".
Data type
Value
USINT
See bit structure.
Bit structure:
Bit
Description
Value
Information
0
0 is added instead of "counter 1"
0
counter 1 - use
1
"counter 1" is used for addition
0
The sign of the "counter 1" register is not changed for addition
1
counter 1 - sign
1
The sign of the "counter 1" register is reversed for addition
0
0 is added instead of "counter 2"
2
counter 2 - use
1
"counter 2" is used for addition
0
The sign of the "counter 2" register is not changed for addition
3
counter 2 - sign
1
The sign of the "counter 2" register is reversed for addition
4 - 7
Reserved
-
Examples of calculation configurations
0b00000001
= 0x01
Only the "counter1 - use" bit is set, entering the contents of the "counter" (edge of counter event channel 1)
directly in the counter register.
0b00000011
= 0x03
"counter 1 - use" and "counter1 - sign" bits are set. The sign is changed so that the counter register counts in
the negative direction.
0b00001101
= 0x0d
Edges on counter input channel 1 increase the value in the counter register. Edges on counter input channel 2
decrease the value in the counter register. This value is the best setting for the modes "AB encoder" and "Up/
down counter".
Summary of Contents for X20 System
Page 2: ......