Division (Fun14) - FATEK FBS Series Manual

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

Advertisement

Basic Function Instruction
FUN 14
D P
(/)
(Performs division 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 division of the data specified at Sa and Sb and writes the quotient and remainder to registers
specified by register D when the division control input "EN" =1 or "EN↑" (
quotient of division is equal to 0 then set FO0 to 1. If the divisor Sb=0 then set the error flag FO1 to 1 without
executing the instruction.
Example 1
16-bit division
Ladder Diagram
X0
EN
U/S
WY
WM
WS
TMR CTR
WY0
WM0
WS0
T0
WY240
WM1896
WS984
T255
14P.(/)
R
Sa:
0
D=0
Sb:
1
R
D :
R
2
ERR
÷
D
Remainder
DIVISION
Sa: Dividend
Sb: Divisor
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
Key Operations
ORG
R0
Sa
256
R1
Sb
12
R3
R2
4
21
Quotient
6-30
Operand
of the division.
SR
ROR
DR
K
R3968
R5000
D0
16/32-bit
+/− number
R4167
R8071
D4095
○*
○*
P
instruction) from 0 to 1. If the
Mnemonic Codes
ORG
FUN
Sa: R
Sb: R
D:
Dividend
Divisor
FUN 14
D P
(/)
XR
V、Z
P0~P9
X
0
14
0
1
R
2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents