Fnc 48 - Sqr / Square Root - Mitsubishi FX3G Series Programming Manual

Programmable controllers
Hide thumbs Also See for FX3G Series:
Table of Contents

Advertisement

FX
/FX
/FX
/FX
3G
3U
3GC
3UC
Programming Manual - Basic & Applied Instruction Edition
12.9
FNC 48 – SQR / Square Root
Outline
This instruction obtains the square root.
The ESQR (FNC127) instruction obtains the square root in floating point operation.
1. Instruction format
FNC 48
D
SQR
2. Set data
Operand type
S
S
1
D
D
S
: K0 to K32767 in 16-bit operation, K0 to K2,147,483,647 in 32-bit operation
1
3. Applicable devices
Bit Devices
Oper-
and
System User
Type
X Y M T C S D .b KnX KnY KnM KnS T
S
S
1
D
Explanation of function and operation
1. 16-bit operation (SQR and SQRP)
The square root of the data stored in
Command
input
2. 32-bit operation (DSQR and DSQRP)
The square root of the data stored in [
Command
input
Caution
1. Operation result
1)
The obtained square root is an integer because the decimal point is ignored.
When the calculated value is ignored, M8021 (borrow flag) turns ON.
2)
When the calculated value is true "0", M8020 (zero flag) turns ON.
Program example
The square root of D10 is stored to D12.
The value of D10 is "100".
X000
FNC 48
SQR
328
Series
Mnemonic
16-bit Instruction
P
5 steps SQR
SQRP
Word device number storing data whose square root is obtained
Data register number storing the square root operation result
Digit Specification
D
S
1
FNC 48
S
D
SQR
D
S
1
FNC 48
S
D
DSQR
S
D
D 10
D 12
=
→ For ESQR (FNC127) instruction, refer to Section 18.15.
Operation Condition
32-bit Instruction
Continuous
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Unit
C D R U \G
is calculated, and stored to
S
D
D
S
+1,
] is calculated, and stored to [
1
S
S
+ 1,
D 10 → D 12
100 → 10
12 Data Operation – FNC 40 to FNC 49
12.9 FNC 48 – SQR / Square Root
Mnemonic
Operation Condition
DSQR
9 steps
DSQRP
16- or 32-bit binary
16- or 32-bit binary
Others
Con-
Real
Index
stant
Number
V
Z Modify K H
E
D
D
.
1
D
D
D
D
+1,
1
1
D
+ 1, D
Continuous
Operation
Pulse (Single)
Operation
Data type
Charac-
Pointer
ter String
" "
P
].

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx3u seriesFx3gc seriesFx3uc series

Table of Contents