Specifications
Program Example 1: Quadrature Counting with an Interrupt
Below is a simple example of how quadrature counting with an interrupt can be programmed.
DL06 Micro PLC User Manual, 3rd Edition, Rev. C
E–30
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
K20
Load constant K20 into the accumulator . This selects
Mode 20 as the HSIO mode.
OUT
V7633
Output this value to V7633, the location of the HSIO
Mode select register .
LD
L
oad the constant required to configure X0 and X1 as a
quadrature absolute input.
OUT
V7634
Output the constant to V7634, the location of the setup
register for X0.
DirectSOFT
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
register for X2.
LD
K2006
Load the constant required to configure X3 as a filtered
input.
OUT
V7637
Output the constant to V7637, the location of the setup
register for X3.
ENI
LDD
K5000
Load the preset 1 value into the accumulator.
OUTD
V3630
Output the accumulator contents to the memory
location for preset 1.
LDD
K10000
Load the preset 2 value into the accumulator.
OUTD
V3632
Output the accumulator contents to the memory
location for preset 2.
LDD
K15000
Load the preset 3 value into the accumulator.
OUTD
V3634
Output the accumulator contents to the memory
location for preset 3.
LDD
KFFFF
Load the constant FFFF into the accumulator. This
value represents the end of the preset list.
OUTD
V3636
Output the accumulator contents to the memory
location for preset 4 (end of preset marker).
UDC
CT174
K18724
END
END coil marks the end of the main program.
CT174 is the HSIO quadrature counter . . The first rung’s SP1
always enables the counter . The dummy input is used by
the built-in compiler .
SP1
SP1
SP1
K2
continued on next page
DirctSOFT