EasyManuals Logo
Home>Mitsubishi>Controller>FX1N Series

Mitsubishi FX1N Series Programming Manual

Mitsubishi FX1N Series
466 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #183 background imageLoading...
Page #183 background image
FX Series Programmable Controlers Applied Instructions 5
5-63
5.5.9 SQR (FNC 48)
Operation 1:
This instruction performs a square root operation
on source data (S) and stores the result at
destination device (D). The operation is conducted
entirely in whole integers rendering the square root
answer rounded to the lowest whole number. For
example, if (S) = 154, then (D) is calculated as
being 12. M8020 is set ON when the square root
operation result is equal to zero. Answers with
rounded values will activate M8021.
Operation 2: This function is equivalent to FNC 127 ESQR This operation is similar to
Operation 1. However, it is only activated when the mode setting float flag, M8023 is used.
This then allows the SQR instruction to process answers in floating point format. The source
data (S) must either be supplied in floating point format for data register use, or it can be
supplied as a constant (K,H). When constants are used as a source, they are automatically
converted to floating point format. Operation 2 is only valid for double word (32 bit) operation,
hence both (S) and (D) will be 32 bit values and the SQR instruction will be entered as DSQR
or DSQRP.
Mnemonic Function
Operands
Program steps
SD
SQR
FNC 48
(Square
root)
Performs a
mathematical
square root e.g.:
K,H,D D SQR, SQRP:
5steps
DSQR,
DSQRP:
9steps
When using M8023 in float mode, only
double word (32bit) data can be processed.
See page 4- 46 for more details regarding float-
ing point.
FX
1S
FX
1N
FX
2N
FX
2NC
D= S
PULSE-P
16 BIT OPERATION
32 BIT OPERATION
Flags
Zero M8020
Borrow M8021
X3
D 2
[ S ] [ D ]
K5
SQR
X10
X7
M8023
M8000
M8023
D 30
D5
DSQR
General note:
Performing any square root operation (even on a calculator) on a negative number will result
in an error. This will be identified by special M coil M8067 being activated:
-168 = Error and M8067 will be set ON
This is true for both operating modes.

Table of Contents

Other manuals for Mitsubishi FX1N Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Mitsubishi FX1N Series and is the answer not in the manual?

Mitsubishi FX1N Series Specifications

General IconGeneral
BrandMitsubishi
ModelFX1N Series
CategoryController
LanguageEnglish

Related product manuals