Basic Function Instruction
6-6
C
COUNTER
(
16-Bit: C0
~
C199, 32-bit: C200
~
C255
)
C
Example 1
16-Bit Fixed Counter
Ladder diagram
Key operations
Mnemonic code
SET
Y1
RST
M1973
M1973
CUP
C 1
X0
CLR
PV :
X1
5
X0
X1
CLR
PV :
5
CUP
C 2
CK
CK
An example of applying
the “Count-Up” status by
using FO0 directly.
ORG
LD
ORG
OUT
LD
ORG
ORG
ORG SHORT
RST M
1973
ORG
X 0
LD X
1
C 1 PV: 5
FO 0
OUT Y
1
ORG SHORT
SET M
1973
ORG X 0
LD X
1
C 2 PV: 5
c
M1973=0
(Defaulted)
d
M1973=1
Count Start
Count-Up
X0
X1
C1
Y1
C2
C2
(CV)
0
0
1
2
3
4
5
6
1
2
3
4
32766
32767
0
0
5
5 times
32767 times
Example 2
32-Bit counter with variable preset value
Like a timer, if the PV of a counter is changed to a register (such as R, D, and so on), the counter will use the
register contents as the counting PV. Therefore, only need to change the register contents to change the PV of
the counter while PLC is running. Below is an example of a 32-bit counter that uses the data register R0 as the
PV (in fact it is the 32-bit PV formed by R1 and R0).
Содержание FBs-CBE
Страница 78: ...MEMO ...
Страница 111: ...4 6 X0 X1 Node A Y0 Y1 Node B differential down Incerse differential up t Scan time Inverse t t ...
Страница 141: ...Basic Function Instruction 6 16 FUN 2 SKP SKIP START FUN 2 SKP Y2 Y1 Y0 T201 10S X0 X1 X2 0 10 0 ...
Страница 305: ...MEMO ...
Страница 348: ...MEMO ...