Справочник Пользователя для Mitsubishi Electronics MELSEC -Q/L
648
7 APPLICATION INSTRUCTIONS
7.12 Special Function Instructions
7.12 Special Function Instructions
BCD 4-digit square roots, BCD 8-digit square roots
BSQR(P), BDSQR(P)
Processing details
■BSQR
• Returns the square root of the value designated at (S), and stores the operation result in the device number designated at
(D).
• Values that can be designated at (S) are BCD values with a maximum of 4 digits (from 0 to 9999).
• The operation results of (D) and (D)+1 are stored as their respective BCD values of between 0 and 9999.
• Operation results are rounded off from the fifth decimal place. For this reason, the fourth decimal place has an error of
• The operation results of (D) and (D)+1 are stored as their respective BCD values of between 0 and 9999.
• Operation results are rounded off from the fifth decimal place. For this reason, the fourth decimal place has an error of
1.
■BDSQR
• Calculates the square root of the values designated by (S) and (S)+1 and stores the results at the device designated by (D).
• BCD value of a maximum of 8 digits (0 to 99999999) can be designated by (S) and (S)+1.
• The operation results of (D) and (D)+1 are stored as their respective BCD values of between 0 and 9999.
• Operation results are rounded off from the fifth decimal place. For this reason, the fourth decimal place has an error of
• The operation results of (D) and (D)+1 are stored as their respective BCD values of between 0 and 9999.
• Operation results are rounded off from the fifth decimal place. For this reason, the fourth decimal place has an error of
1.
Operation error
• In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
(S): Data of which the square root is obtained or the number of the device where the data is stored (BSQR(P): BCD 4 digits, BDSQR(P): BCD 8 digits)
(D): Head number of the devices where the operation result will be stored (BCD 4 digits)
(D): Head number of the devices where the operation result will be stored (BCD 4 digits)
Setting
data
data
Internal device
R, ZR
J\
U\G
Zn
Constant
K, H
K, H
Others
Bit
Word
Bit
Word
(S)
(D)
Error
code
code
Error details
Q00J/
Q00/
Q01
Q00/
Q01
QnH
QnPH
QnPRH QnU
LCPU
4100
The data specified in (S) is not a BCD value.
Process
High
performance
Redundant Universal
LCPU
Basic
Command
Command
P
S
D
S
D
BSQR,BDSQR
BSQRP,BDSQRP
BSQR/BDSQR
+1
D
S
D
Integer part
Decimal fraction part
.
+1
D
S
D
(
)
2-word data
+1
Integer part
Decimal fraction part
.
S