(Fun17) - FATEK FBS Series Manual

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

Advertisement

Basic Function Instruction
FUN 17
D P
(Compares the data of Sa and Sb and outputs the results to function Outputs)
CMP
Range
WX
WY
WX0
WY0
Ope-
rand
WX240
WY240
Sa
Sb
Compares the data of Sa and Sb when the compare control input "EN" =1 or "EN↑" (
1. If the data of Sa is equal to Sb, then set FO0 to 1. If the data of Sa>Sb, then set FO1 to 1. If the data of
Sa<Sb, then set FO2 to 1. If the data of Sa < Sb, then set the FO2 to 1.
Example
Compares the data of 16-bit register
Ladder diagram
17.CMP
X0
EN
U/S
From the above example, we first assume the data of R0 is 1 and R1 is 2, and then compare the data by
executing the CMP instruction. The FO0 and FO1 are set to 0 and FO2 (a<b) is set to 1 since a<b.
If you want to have the compound results, such as≧、≦、< > etc., please send =、< and > results to relay first
and then combine the result from the relays.
M1919=0, when this command in not executed, FO0, FO1, FO2 will remain in the status at last execution.
M1919=1, when this command in not executed, FO0, FO1, FO2 are all cleared to 0.
Control M1919 properly to obtain memory-holding function for functional command output.
WM
WS
TMR
CTR
WM0
WS0
T0
WM1896
WS984
T255
C255
R
0
a=b
Sa :
Sb :
1
R
a>b
a<b
COMPARE
HR
IR
OR
C0
R0
R3804
R3904
R3839
R3903
R3919
Key operations
ORG
Y0
OUT
6 - 3 4
Operand
Sa: The register to be compared
Sb: The register to be compared
Sa, Sb may combine with V, Z, P0~P9 to
serve indirect addressing
HR
HSCR RTCR
SR
R3920
R4096
R4128
R4136
R4047
R4127
R4135
R4167
Mnemonic code
ORG
FUN
Sa :
Sb :
FO
OUT
FUN 17
D P
CMP
ROR
DR
K
R5000
D0
16/32 bit
+/-number
R8071
D4095
P
instruction) from 0 to
X
0
17
R
0
R
1
2
Y
0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents