Specifications
Program Example 2: Counter With Presets
The following example shows how to program the HSIO circuit to trigger on three preset
values. You may recall the industrial lathe example from the beginning of this appendix. This
example program shows how to control the lathe cutter head to make three grooves in the
work-piece at precise positions. When the lead screw turns, the counter device generates
pulses which the DL06 can count. The three preset variables A, B, and C represent the
positions (number of pulses) corresponding to each of the three grooves. 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–18
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
Industrial Lathe
A
Preset Data
V
3630
0000
V
3632
0
000
V3634 0000
V
3636
0
000
1500
3
780
4850
F
FFF
BC
A
B
C
Counter
Device
Start
Lead screw
Cutter head
X4 - Cutter head retracted
Y0 - Lead screw motor
Y1 - Cutter head solenoid
X3 - Cutter head extended
I/O
Assignments
SP0
LD
K10
Load constant K10 into the accumulator. This
selects Mode 10 as the HSIO mode.
OUT
V7633
Output the constant to V7633, the location of
HSIO Mode select register.
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.
Select Mode 10
Direct SOFT
SP0
ENI
Enable Interrupts before reaching a preset
generates an interrupt. Special Relay SP0 is on
during the first CPU scan.
LD
K107
Load the constant required to configure X2 as an
external reset with interrupt.
OUT
V7636
Output the constant to V7636, the location of the
setup parameter for X2.
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.
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.
LDA
O3630
Load the octal address O3630 into the
accumulator. This instruction automatically
converts the address into hex.
OUT
V7630
Output this address to V7630, the location of
the pointer to the Preset Table.
continued on next page