Specifications

Program Example 3: Counter With Preload
The following example shows how you can preload the current count with another value.
When the preload command input (X4 in this example) is energized, we disable the counter
from counting with C0. Then, we write the value K3000 to the count register (V1076-
V1077). We preload the current count of the counter with K3000. When the preload
command (X4) is turned off, the counter resumes counting any pulses, but now starting from
K3000. In this example, only one high-speed counter is used. The second counter could be
used in the same manner.
DL06 Micro PLC User Manual, 3rd Edition, Rev. C
E–21
Appendix E: High-speed Input and Pulse Output Features
1
2
3
4
E
6
7
8
9
10
11
12
13
14
A
B
C
D
SP0
LD
K10
Load constant K10 into the accumulator. This
selects Mode 10 as the HSIO mode.
OUT
V7633
Output this address to V7633, the location of
HSIO Mode select register.
LD
K1006
Load the constant required to configure X2 as
a filtered input.
OUT
V7636
Output the constant to V7636, the location of the
setup parameter for X2.
Select Mode 10
DirectSOFT
SET
Set C0 on at powerup to enable counting.
C0
UDC
CT174
K99999999
C0
CT174 is the HSIO counter. The first rung’s C0
contact enables the counter. The dummy input is in
the middle.
SP0
LD
K1
Load the constant required to configure X0 as
the counter clock.
OUT
V7634
Output the constant K1 to V7634, the location of
the setup parameter for X0.
The third rung’s Reset input is normally off,
because we will use the external reset. You can
optionally reset the counter value on each powerup
using the SP0 contact.
LD
K1006
Load the constant required to configure X1 as
a filtered input.
OUT
V7635
Output the constant to V7635, the location of the
setup parameter for X1.
LD
K1006
Load the constant required to configure X3 as
a filtered input.
OUT
V7637
Output the constant to V7637, the location of the
setup parameter for X3.
C2
C1
continued on next page