Fnc 48 - Sqr / Square Root - Mitsubishi Electric FX3G SERIES Programming Manual

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

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
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
P
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 C D R U \G
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
Mnemonic
16-bit Instruction
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
is calculated, and stored to
1
FNC 48
S
D
SQR
D
S
+1,
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
9 steps
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Unit
V
D
D
1
S
D
D
S
] is calculated, and stored to [
1
S
S
D
+ 1, D
+ 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
Continuous
DSQR
Operation
Pulse (Single)
DSQRP
Operation
Data type
16- or 32-bit binary
16- or 32-bit binary
Others
Con-
Real
Charac-
Index
stant
Number
ter String
Z Modify K H
E
" "
.
D
D
+1,
D
D
].
1
1
11
12
13
14
15
Pointer
P
16
17
18
19
20
335

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx3u seriesFx3uc series

Table of Contents