Addition (Fun11) - FATEK FBS Series Manual

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

Advertisement

Basic Function Instruction
FUN 11
D P
(+)
(Performs addition of the data specified at Sa and Sb and stores the result in D)
Symbol
WX
Range
WX0
Ope-
rand
WX240
Sa
Sb
D
Description
Performs the addition of the data specified at Sa and Sb and writes the results to a specified register D
when the add control input "EN" =1 or "EN↑" (
0 then set FO0 to 1. If carry occurs (the result exceeds 32767 or 2147483647) then set FO1 to 1. If borrow
occurs (adding negative numbers resulting in a sum less than -32768 or -2147483648), then set the FO2 to
1. All the FO statuses are retained until this instruction is executed again and overwritten by a new result.
Example
16-bit addition
Ladder Diagram
11P.(+)
X0
EN
Sa :
Sb :
D :
U/S
WY
WM
WS
TMR CTR
WY0
WM0
WS0
T0
WY240
WM1896
WS984
T255
D=0
R
0
1
R
Y0
R
2
CY
BR
Sa
R0
Sb
R1
D
R2
Y0=1 (carry 1 represents +32768)
ADDITION
Sa: Augend
Sb: Addend
D : Destination register to store the results
Sa, Sb, D may combine with V, Z, P0~P9
to serve indirect addressing
HR
IR
OR
C0
R0
R3840
R3904
C255
R3839
R3903
R3967
D
instruction) from 0 to 1. If the result of addition is equal to
Key Operations
ORG
OUT
12345
R0+R1=32770
20425
X0=
32768+2=32770
2
6-26
Operand
of the addition
SR
ROR
DR
K
R3968
R5000
D0
16/32-bit
+/− number
R4167
R8071
D4095
○*
○*
Mnemonic Codes
ORG
FUN
11P
Sa: R
Sb: R
D:
FO
OUT
FUN 11
D P
(+)
XR
V、Z
P0~P9
X
0
0
1
R
2
1
Y
0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents