Up/Down Counter (Fun07); 7: Udctr - FATEK FBS Series Manual

Plc
Hide thumbs Also See for FBS Series:
Table of Contents

Advertisement

FUN 7
D
UDCTR
Symbol
Clock
CK
Up/Down count
U/D
Clear counter
CLR
WX
Range
WX0
Ope-
rand
WX240
CV
PV
Description
When the clear control "CLR" is 1, the counter's CV will be reset to 0 and the counter will not be able to
count.
When the clear control "CLR" is 0, counting will then be allowed. The nature of the instruction is a P
instruction. Therefore, when the clock "CK↑" is 0→1 (rising edge), the CV will increased by 1 (if U/D=1) or
decreased by 1 (if U/D=0).
When CV=PV, FO0("Count-Up) will change to 1". If there are more clocks input, the counter will continue
counting which cause CV≠PV. Then, FO0 will immediately change to 0. This means the "Count-Up" signal
will only be equal to 1 if CV=PV, or else it will be equal to 0 (Care should be taken to this difference from
the "Count-Up" signal of the general counter).
The upper limit of up count value is 32767 (16-bit) or 2147483647 (32-bit). After the upper limit is reached,
if another up count clock is received, the counting value will become –32768 or -2147483648 (the lower
limit of down count).
The lower limit of down count value is -32767 (16-bit) or -2147483647 (32-bit). After the lower limit is
reached, if another down count clock is received, the counting value will become 32768 or 2147483648
(the upper limit of up count).
If U/D is fixed as 1, the instruction will become a single-phase up count counter. If U/D is fixed as 0, the
instruction will become a single-phase down count counter.
Example
The diagram below is an application example of UDCTR instruction being applied to an encoder.
UP/DOWN COUNTER
(16-bit or 32-bit up and down 2-phase Counter)
Ladder symbol
7D.UDCTR
CV :
CUP
PV :
WY
WM
WS
TMR CTR
WY0
WM0
WS0
T0
WY240
WM1896
WS984
T255
Black
2-phase encoder
Count-UP (FO0)
CV: The number of the Up/Down Counter
PV: Preset value of the counter or it's
HR
IR
OR
C0
R0
R3840
R3904
C255
R3839
R3903
R3967
Red (POWER + 24VDC)
Green (B phase)
White (A phase)
SW
C
X16
X17
PLC
6 - 21
Basic Function Instruction
Operand
register number
SR
ROR
DR
R3968
R5000
D0
16/32-bit
+/− number
R4167
R8071
D4095
○*
○*
X18
FUN 7
D
UDCTR
K

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents