Fnc 48 - Sqr / Square Root - Mitsubishi Electric MELSEC FX3U Programming Manual

Melsec fx series programmable logic controllers
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
SQR
P
2. Set data
Operand type
S
S
1
D
: K0 to K32767 in 16-bit operation, K0 to K2,147,483,647 in 32-bit operation
D
S
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.
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
is calculated, and stored to
D
S
1
FNC 48
S
D
SQR
+1,
D
S
1
FNC 48
S
D
DSQR
12 Data Operation – FNC 40 to FNC 49
→ 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
Index
Unit
V Z Modify K H
D
S
D
] is calculated, and stored to [
D
S
1
S
S
D
+ 1, D
+ 1,
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-
stant
Number
ter String
E
" "
.
D
1
+1,
].
D
D
D
D
1
1
11
12
13
14
15
Pointer
P
16
17
18
19
20
349

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents