Specifications
Program Example (cont’d)
DL05 Micro PLC User Manual, 6th Edition, Rev. C
E–22
Appendix E: High-speed Input and Pulse Output Features
1
2
3
D
E
6
7
8
9
10
11
1
1
14
A
B
C
D
S
P0
L
D
K20
Load constant K20 into the accumulator. This selects
Mode 20 as the HSIO mode.
OUT
V7633
Output this address to V7633, the location of the HSIO
Mode select register.
LD
K2
Load the constant required to configure X0 as Phase A
input.
OUT
V
7634
Output the constant to V7634, the location of the setup
register for X0.
DirectSOFT
UDC
CT76
K99999999
C1
C0
C2
END
END coil marks the end of the main program.
CT76 is the HSIO quadrature counter. The first rung’s C0
always enables the counter. The dummy input is used by
the built-in compiler.
LD
K0
Load the constant required to configure X1 as Phase B
input.
OUT
V7635
Output the constant to V7635, the location of the setup
r
egister for X1.
LD
K7
Load the constant required to configure X2 as an external
reset.
OUT
V7636
Output the constant to V7636, the location of the setup
register for X2.
SET
Set C0 on at powerup to enable counting.
C0
SP0
Select Mode 20
The third rung’s Reset input is normally offf,
because we will use the external reset. You can
optionally reset the counter value on each powerup
using the SP0 contact.
SP1
LDD
V1076
Load the current value of the counter into the accumulator
on each scan.
CMPD
K44292
Compare the value in the accumulator with the constant
K44292. If they are equal, the SP61 contact will be
turned on.
Set Y0 to ON when the counter reaches or exceeds
our comparison value while COUNTING UP.
SP61
SET
Y0
*
SP62
SP61
SET
Y1
*
SP60
Set Y1 to ON when the counter reaches or goes below
our comparison value while COUNTING DOWN.
* NOTE: You can reset Y0 and Y1 at a convenient stage in the program by using the RST instruction.