Download 1761-6.2, MicroLogix 1000 with Hand

Transcript
Chapter 14
Using High-Speed Counter Instructions
Adding to File 2
Ladder Rungs
Rung 2:0
Initializes the high–speed counter each time that the RRUN mode is
entered. The high–speed counter data area (N7:5 – N7:9) was chosen to
correspond with the starting address (source address) of our HSL
instruction. Note that the HSC instruction is disabled each entry into
the RRUN mode until the first time that it is executed as true. (The high
preset was ”pegged” on initialization to prevent a high preset interrupt
from occurring during the initialization process.)
| 1’st
Output Mask
|
| Pass
(only use bit 0
|
|
ie. O:0/0)
|
|
S:1
+MOV–––––––––––––––+
|
|––––] [–––––––––––––––––––––––––––––––––––––+–+MOVE
+–+–|
|
15
| |Source
1| | |
|
| |
| | |
|
| |Dest
N7:5| | |
|
| |
0| | |
|
| +––––––––––––––––––+ | |
|
| High Output Pattern | |
|
|
(turn off O:0/0)
| |
|
|
| |
|
| +MOV–––––––––––––––+ | |
|
+–+MOVE
+–+ |
|
| |Source
0| | |
|
| |
| | |
|
| |Dest
N7:6| | |
|
| |
0| | |
|
| +––––––––––––––––––+ | |
|
| High Preset Value
| |
|
| (counts to next hole)| |
|
| |
|
| +MOV–––––––––––––––+ | |
|
+–+MOVE
+–+ |
|
| |Source
32767| | |
|
| |
| | |
|
| |Dest
N7:7| | |
|
| |
0| | |
|
| +––––––––––––––––––+ | |
|
| Low output pattern | |
|
|
(turn on O:0/0
| |
|
|
each reset)
| |
|
| |
|
| +MOV–––––––––––––––+ | |
|
+–+MOVE
+–+ |
|
| |Source
1| | |
|
| |
| | |
|
| |Dest
N7:8| | |
|
| |
0| | |
|
| +––––––––––––––––––+ | |
|
| Low preset value
| |
|
| (cause low preset
| |
|
|
int at reset)
| |
|
| |
|
| +MOV–––––––––––––––+ | |
|
+–+MOVE
+–+ |
|
| |Source
0| | |
|
| |
| | |
|
| |Dest
N7:9| | |
|
| |
0| | |
|
| +––––––––––––––––––+ | |
|
| High Speed Counter | |
|
|
| |
|
| +HSL–––––––––––––––+ | |
|
+ –+HSC LOAD
+–+ |
|
|Counter
C5:0|
|
|
|Source
N7:5|
|
|
|Length
5|
|
|
+––––––––––––––––––+
|
14–29