Rockwell Automation 1336E IMPACT Adjustable Frequency AC Drive User Manual V 1-4.XX User Manual
Page 185

Using the Function Block
10-15
Figure 10.18
Up/Down Counter Function Block
When a rising edge occurs, on In1, the output is incremented by the
value in In4, and on In2, the output is decremented by the value in
In5. The output can be either a word or a double word.
To clear the counter, set In3, which loads the counter with the In7
value. As long as In3 is set, the counter remains at the In7 value, even
if In1 or In2 is toggling.
As an example of the up/down counter function block, you could
create a shuttle. When you press the start button, a start forward
command is sent to the drive, the shuttle begins to move from A to H,
and the drive follows the first preset speed. As the shuttle passes each
switch, the value of In1 is incremented and a new speed reference is
used. The speed references are set using Speed Ref 1 (parameter 29)
through Speed Ref 7 (parameter 36).
When the shuttle reaches relay H, then a stop command is issued and
the value of In1 is decremented. When you press the start button
again, a start reverse command is sent to the drive and the shuttle
moves from H to A following the preset speeds as they are
incremented by each switch.
Figure 10.19 shows an example of a shuttle.
200
Func 1 Eval Sel
0 – 17
198
Function In1
199
Func 1 Mask/Val
I
V
Up/Down Counter
Function Block
203
Func 2 Eval Sel
0 – 17
201
Function In2
202
Func 2 Mask/Val
I
V
212
Function Sel
11
In1 – Count up (rising edge)
In2 – Count down (rising edge)
In3 – Load counter with 0
In4 – Up increment
In5 – Down increment
In6 –
If:
Then Output is:
False
A word
True
A double word
In7
Clr Value
In1
In2
213
Function Output 1
206
Func 3 Eval Sel
0 – 17
204
Function In3
205
Func 3 Mask/Val
I
V
In3
208
Function In5
209
Function In6
In5
In6
207
Function In4
In4
214
Function Output 2
(For the double word
for Input 6)
210
Function In7
In7
If In6 is:
Then the output is:
False
A word value passed to Function Output 1.
True
A double word value with the high word passed to Function Output 1
and the low word passed to Function Output 2.