GE GFK-0804B 用户手册

下载
页码 160
4
4-21
GFK-0804B
Chapter 4  The Micro PLC Instruction Set
Down Counter
 
The Down Counter turns on an output when the count reaches zero (from 65535 to 0 if a
register is used to load the counter, or 32767 to 0 if a constant is used).  To program a
counter function, enter two inputs (in the example below, I1, and I2), and two
parameters (R2 and R386 in the example).
The first input decrements the count value. In this example, each time the Positive
Transition contact transitions on, the count total stored in R1 goes down by 1. The
second input to the counter resets the count total (here, in R1) to its maximum value. It
also deactivates the output coil.
The first parameter of the Down Counter is a register containing the value that is being
incremented (usually, by an input in the application program). Register R1, used in this
example, is not a “retentive” register; it is cleared if power goes off. If the current count
value should be saved with the power off, use a register from R385 to R500.
The second counter parameter is the counter total If this number should always be the
same, you can enter it directly, as shown in the example Up Counter. Or, if you want to
be able to change the counter total, instead enter a register from R385 to R500 as the
second parameter for the counter (see the example). The counter total can then be
placed in that register, either by program logic, or from the Hand-held Progammer or
programming software.
When the program encounters a register location as the second parameter of the timer, it
looks in that register for the value it contains, and uses that value as the timer length. So
for this example, timing is the same as for the previous example.
Programming Software Instructions
If you are using the programming software, refer to the instructions on page 4-19.
Example and HHP Instructions
Ladder Diagram
Hand-held Programmer
Timing Diagram
Each time input I1 transitions on, the
content of register R1 is decremented.
When it reaches 0, output coil C2
activates.
Input I2 is used to reset counter R2 to
5. It also deactivates coil C2.
I1
C2
START
START
CNTR
OUT
F1
F2
I1
I2
R2
R386
C2
Input I1
Register R2
Coil  C2
I2
R2
DNCTR
R386
Input I2
"
4
0
1
2
3
4
5
5
46129