Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
11 Applied Instructions (Data Operation)
11.9 SQR / Square Root
249
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
11
Applied Instructions
(Data Operation)
12
Applied Instructions
(High Speed
Processing)
13
Applied Instructions
(Handy
Instruction)
14
Applied Instructions
(External FX I/O
Device)
15
Applied Instructions
(External Device
(optional device))
16
Applied Instructions
(External Device)
17
Applied Instructions
(Data Transfer 2)
18
Applied Instructions
(Floating Point)
19
Applied Instructions
(Data Operation 2)
20
Applied Instructions
(Positioning
Control)
Function and operation explanation
1. 16-bit operation (SQR, SQRP)
The square root of the data stored in the device specified by is calculated, and stored to the device
specified by ).
2. 32-bit operation (DSQR, DSQRP)
The square root of the data stored in the device specified by is calculated, and stored to the device
specified by ).
Cautions
1) The instruction is provided in the FXU PLC Ver. 3.07 or later.
2) The obtained square root is an integer because the decimal point is ignored.
When the decimal point is ignored, M8021 (borrow flag) turns ON.
3) When the calculated value is true "0", M8020 (zero flag) turns ON.
4) Some restrictions to applicable devices
S1:The FX
3U and FX3UC PLCs only are applicable.
Program examples
Command input
Root data
Resulting data
SQR
EN
s
ENO
d
ds
Command input
Root data Resulting data
DSQR
EN
s
ENO
d
+1,
+1,
ds ds
D 10 D 12
100 10
=
The square root of D10 is stored to D12.
The value of D10 is "100".
X000
D10
D12
SQR
EN
s
ENO
d
[Structured ladder/FBD]
[ ST ]
SQR(X000, D10, D12);