
Setting notes:
1. It only can be written when count of CH0 and CH1 are disabled (bit 0 and bit4 of CR#4 are 0).
2. After writing, it will initial controlled registers as follows: CR#1=0, CR#4,5=65,536, CR#6,7=65,536,
CR#10,11=0, CR#12,13=32,767, CR#14,15: 32,767, CR#16,17=0, CR#18,19=0, CR#20,21=0, CR#22,23=0,
CR#24,25=0 and CR#26,27=0.
1-phase 1 input (K8~K11) 1-phase 2 inputs (K6~K7)
$External input count up/down
control (K8~K9)
$Internal controlled register count
up/down control (K10~K11) $1-phase 2 inputs counter (K6, K7)
count up count down
Off ( )count up On ( )count down
A i np u t
B input
count
value
K0 K1
CR#1
A i n p ut
count
value
count up count down
11220333
A inp u t
B input
count value
pulse of count up
pulse of count down
2-phase 2 inputs (K0~K5)
$Normal frequency (K0, K1) $Double frequency (K2, K3) $Four times frequency (K4, K5)
A i n p ut
B input
count value
112002
A i n p ut
B input
count value
1122034 30
A i np ut
B input
count value
1357024 67531
64 2
#5 #4 H 4162 ╳R/W Ring length of CH0 16-bit mode, factory setting: K65,536
#7 #6 H 4164 ╳R/W Ring length of CH1 16-bit mode, factory setting: K65,536
Example:
M0
DTO K0 K4 K200 K1
Take CH0 as example:
Write K200 into first extension module CR#5 and CR#4 (i.e.
CR#5 = 0, CR #4 = 200). Setting range: K2 to K65,536.
198 199 10
01 199 198
Count up
Count down
When ring length is set to K200, the count value will be as
shown on the left.
Count up: when count value reaches 199, the next count
value will be 0.
Count down: when count value reaches 0, the next count
value will be 199.
Setting notices:
1. It must write with 32-bit.
2. It only can be write-in when writing value is greater or equal to current count value.
3. It only can be set when counter stops counting and count mode is 16-bit.
#9 #8 H 4166 ╳R/W CH0 factory setting
Factory setting for CH0 counter (#10: Lower word / #11:
Upper word), factory setting: K0
Setting notes: in 16-bit mode, CR#9 will be cleared to 0
when writing factory setting.
#11 #10 H 4168 ╳R/W CH1 factory setting
Factory setting for CH1 counter (#10: Lower word / #11:
Upper word), factory setting: K0
Setting notes: in 16-bit mode, CR#11 will be cleared to 0
when writing factory setting.
#13 #12 H 416A ╳R/W YH0 comparison value
YH0 output comparison value (#12: Lower word / #13:
Upper word), factory setting: K32,767.
Setting notes: in 16-bit mode, CR#13 will be cleared to 0
when writing YH0 comparison value.
#15 #14 H 416C ╳R/W YH1 comparison value
YH1 output comparison value (#14: Lower word / #15:
Upper word), (factory setting: K32,767).
Setting notes: in 16-bit mode, CR#15 will be cleared to 0
when writing YH1 comparison value.
Take CH0 as example:
When current value of counter CH0= CH0 comparison value,
output YH0 will be ON and hold. User can clear output by using b8
and b10 of CR#2.
If count value of CH0 = comparison value by using PRESET or
instruction TO, corresponding output YH0 will be OFF. In other
case that count value = comparison value does not use PRESET
or instruction TO, corresponding output YH0 will be ON.
CR#2
b8 SET CR#2
b8 SET
current value
of counter
Comparison
value
Comparison
value
current value
of counter
current value
of counter
current value
of counter
#17 #16 H 416E ╳R/W Current value of counter
for CH0
Current value of counter for CH0(#16: Lower word / #17:
Upper word), factory setting is K0.
Setting notes:
1. It must write with 32-bit.
2. In 16-bit mode, value that is written must be less than
ring length (CR#4, 5).
3. In 16-bit mode, CR#17 will be cleared to 0 when
writing into current value of counter.
#19 #18 H 4170 ╳R/W Max. count value for CH0 Max. count value for CH0 (#18: Lower word / #19: Upper
word), factory setting is K0.
#21 #20 H4172 ╳R/W Min. count value for CH0 Min. count value for CH0 (#20: Lower word / #21: Upper
word), factory setting is K0.
#23 #22 H 4174 ╳R/W Current value of counter
for CH1
Current value of counter for CH1(#22: Lower word / #23:
Upper word), factory setting is K0.
Setting notes:
1. It must write with 32-bit.
2. In 16-bit mode, value that is written must be less than
ring length (CR#6, 7).
3. In 16-bit mode, CR#23 will be cleared to 0 when
writing into current value of counter.
#25 #24 H 4176 ╳R/W Max. count value for CH1 Max. count value for CH1 (#24: Lower word / #25: Upper
word), factory setting is K0.
#27 #26 H4178 ╳R/W Min. count value for CH1 Min. count value for CH1 (#26: Lower word / #27: Upper
word), factory setting is K0.
#28 H 417A
╳R Comparison result Comparison result
CR#28 ‘0’(Off) ‘1’(On) CR#28 ‘0’(Off) ‘1’(On)
b2 Setting value≦
current value
Setting value >
current value b6 Setting value≦
current value
Setting value >
current value
YH0
b1 Setting value≠
current value
Setting value =
current value
YH1
b5 Setting value≠
current value
Setting value =
current value
CR#28 ‘0’(Off) ‘1’(On) CR#28 ‘0’(Off) ‘1’(On)
b0 Setting value≧
current value
Setting value <
current value b4 Setting value≧
current value
Setting value <
current value
#29 H 417B
○R Action status The indication of CH0/CH1 count up/down and terminal
status(On/Off)
CR#29_CH0 ‘0’(Off) ‘1’(On) CR#29_CH1 ‘0’(Off) ‘1’(On)
b0 - Count up (Up_0) b8 - Count up(Up_1)
b1 - Count down (Dn_0) b9 - Count down (Dn_1)
b2 A0 input is Off A0 input is On b10 A1 input is Off A1 input is On
b3 B0 input is Off B0 input is On b11 B1 input is Off B1 input is On
b4 PRE0 input is Off PRE0 input is On b12 PRE1 input is Off PRE1 input is On
b5 DIS0 input is Off DIS0 input is On b13 DIS1 input is Off DIS1 input is On
b6 YH0 output is Off YH0 output is On b14 YH1output is Off YH1 output is On
b7 Reserved b15 Reserved
#31 H 417D
╳R Error Status Data register that is used to save all error status. Refer to table below.
CR#31 Error Status
b0 Overflow indication of CH0 count up. When count-up value exceeds upper limit(upper limit is CR#4,5 in 16-bit
mode and it is K2,147,483,647 in 32-bit mode)
b1 Overflow indication of CH0. When count-down value is less than lower limit(lower limit is 0 in 16-bit mode and
it is K-2,147,483,648 in 32-bit mode)
b2 Overflow indication of CH1 count up. When count-up value exceeds upper limit(upper limit is CR#6, 7 in
16-bit mode and it is K2,147,483,647 in 32-bit mode)
b3 Overflow indication of CH1. When count-down value is less than lower limit(lower limit is 0 in 16-bit mode and
it is K-2,147,483,648 in 32-bit mode)
b4~b5 Reserved
b6 The CR number designated by FROM/TO instruction exceeds range
b7 RS-485 communication setting (CR#33 and CR#34) error
b8~b15 Reserved
#32 H 417E
○R System version Hexadecimal, display current software version, such as version 1.0A
will be displayed as H’010A.
#33 H 417F
○R/W Communication
address setting
Setting RS-485 communication address. Setting range is 01-254.
Factory setting is K1.
#34 H 4180
○R/W Baud Rate
Setting
Communication baud rate could be 4800 / 9600 / 19200 / 38400 /
57600 / 115200. For ASCII mode, data format is 7Bits, even, 1 stop bit
(7 E 1). For RTU mode, data format is 8Bits, even, 1 stop bit (8 E 1).
b0: 4800 bps. b1: 9600 bps. (factory setting)
b2: 19200 bps. b3: 38400 bps.
b4: 57600 bps. b5~b14: Reserved.
b15: ASCII / RTU mode switch.
CR#0~CR#34: The corresponding addresses are H 415E-H 4180 for user to read/write by using RS-485.
1. Baud rate could be 4800, 9600, 19200, 38400 and 57600bps.
2. Communication protocol can be Modbus ASCII mode and RTU mode. For ASCII mode, data format is 7Bits,
even, 1 stop bit (7 E 1). For RTU mode, data format is 8Bits, even, 1 stop bit (8 E 1).
3. Function code: 03H: read register data. 06H: write one WORD data into register. 10H: write multiple WORDs into
register.
5 TRIAL RUN & TROUBLESHOOTING
MPU connects to HC extension module
1. Make sure that the power of MPU and extension unit is OFF before wiring.
2. Open extension port of EH MPU and connect to HC extension unit with cable. There is no connection order for
EH MPU to connect extension unit, mix connection is allowed.
3. The power supply of HC extension unit must be external +24VDC power supply.
4. Before power up, check if the load circuit of outputs YH0 and YH1 is correct, especially the circuit between YH0+,
YH0- and YH1+, YH1-. There is a Zener Diode that is connected between YH0+, YH0- and YH1+, YH1- in HC. If
the positive/negative pole is wrong, it may cause unexpected result.
YH0+ YH1+
YH1-
YH0-
DC 5~24VDC
Load
YH0+ YH1+
YH1-
YH0-
DC 5~24VDC
load
5. Before power up, check if A phase or B phase connects to correct voltage level. (there are three voltage level:
+24, +12V and +5V) If +24V signal connects to +5V input terminal, it may damage internal circuit.
6. After power up MPU, it will start to detect extension module. If no external +24VDC power is applied to HC at
this time or power is applied after EH MPU completing detecting extension module, the connection will fail.
Therefore, power wiring and power supply timing should be as following.
Power wiring
85~264VAC
AC/DC +24V_EXT
+24V_INT
01HCEH MPU
+24V input
LNG
+24V 24G
+24V 0V
Power supply
Timing analysis
When power supply for HC is +24V_INT:
t5>t3, power is ON and the connection of HC extension
unit is normal.
When power supply for HC is +24V_EXT:
Because start time (t2) of external power supply for HC
extension module is unknown, user must make sure that
t2+t4<t1+t5, otherwise HC extension module cannot be
detected by MPU.
Power supply timing
+24V_INT
+24V_EXT
t1
t2
t3
t4
t5
t1:1~2 seconds
t2:1~3 seconds
t3:0.5~1 seconds
t4:0.5~1 seconds
t5:2 seconds
AC power input
complete initialling HC
(supply from +24_INT)
complete initialling HC
(supply from +24_EXT)
MPU starts to detect
extension unit
7. After completing above steps, power up MPU and connect to PC with cable DVPACAB215. When using
WPLSoft to read peripherals status to make sure that HC connects to MPU.
Open WPLSoft
Click View> Workspace
Workspace display
Double click “ ” for communication.
It is communicating.
Note: All communication settings, including baud rate,
communication port and communication
address, should be set before communicating.
Complete communicating.
$It means communication is successful when
“02HC” displays in special module.
8. The maximum special extension modules number for EH MPU connects is 8 special extension modules. After
power is ON, EH will save module codes of connected special modules in D1320~D1327 in order. The module
code of 02HC is H’0220. It indicates communication is OK when H’0220 is displayed in the corresponding
special D register by using HPP02 or other monitor software.
Troubleshooting
Judge the errors by the indicators on the front panel. When errors occurred on DVP PLC, please check:
☼“POWER” LED
The “POWER” LED at the front of HC extension module will be lit (in green) if the power is on. If the
indicator is not on when power up, please remove the wiring on terminals +24V. Once the indicator lights
after this, it means that the 24V DC power supply of the PLC is overloaded. Please do not use the DC
power supply from the +24V terminals, but use a DC24V power supply instead.
☼L.V. LED
The “L.V.” LED at the front of HC extension module will be lit if input voltage is not enough. The extension
module won’t active at this time.
6 RELATIVE INSTRUCTIONS AND EXAMPLES
API
78 DFROM P Read Special Module CR Data
Instruction
Explanation
: number of special module (m1=0~7). : CR number of special module that will be read.
: address for saving reading data. : data number for reading once.
Program
Example
Writing special module #0 of CR#24 into D0 and special module #0 of CR#25 into D1. only write
two data once (n=2).
X10
FROM K0 K24 D0 K2
API
79 DTO P Special Module CR Data Write In
Instruction
Explanation
: number of special module (m1=0~7). : CR number of special module that will be
wrote in. : data to write in CR. : data number to write in once.
Program
Example
Using 32-bit instruction DTO to write D11 and D10 into special module#0 of CR#3 and CR#2. only
write a data once (n=1).
X11
DTO K0 K2 D10 K1
Application Example:
Following program is the application example of CH0 for 02HC:
Setting CR#2 to disable count mode before setting.
Setting counter to be 1-phase 1 input (CR#3) of 16-bit mode, ring length of CH0 is 2000 (CR#4, 5) and
factory setting is 100 (CR#8). When count value of CH0 reaches 500, YH0 is ON (CR#12).
Using X0~X11 to set instructions (CR#2).
Reading values, including current value of counter for CH0 (CR#16), max. count value for CH0 (CR#18),
min. count value for CH0(CR#20), comparison result for CH0(CR#28), terminal status (CR#29) and error
status (CR#31).
K0 K1
K0
K2
K9 K1
M1002
K0
TO
TO
M100
K0 K1
DTO
K0 K100 K1
K8
DTO
K0 K500 K1
K12
DTO
K3
K4 K2000
X0
M101
X1
M102
X2
M108
X3
M109
X4
M112
X7
K4M100 K1
K2
M1000
K0
TO
D0 K1
K0
K16
D2 K1
M1000
K0
DFROM
K18
K0 D4 K1
K20
K0 D6 K1
K28
K0 D8 K1
K29
K0 D10 K1
K31
DFROM
DFROM
FROM
FROM
FROM
CR#2: count is disabled
CR#3: setting to K9 to indicate
16-bit and 1-phase 1 input counter
(hardware).
CR#4,5: ring length: 2000
CR#8,9: factory setting=K100
CR#12,13: YH0 comparison value=500
X0: start counting
X1: PRESET is enabled
X2: YH0output is enabled
X3: clear YH0 (RESET
X4: YH0 is ON (SET)
X7: clear error flag
CR#2: transmit instruction
CR#16,17: current value of counter
CR#18,19: max. count value
CR#20,21: min. count value
CR#28: comparison result
CR#29: terminal status
CR#31: error status