7 APPLICATION INSTRUCTIONS
7.9 Real Number Instructions
827
7
Calculating the square root of BCD 4-digit data
BSQRT(P)
These instructions calculate the square root of the value specified by a BCD 4-digit data.
■Execution condition
■Descriptions, ranges, and data types
■Applicable devices
• These instructions calculate the square root of the BCD 4-digit data specified by (s), and store the operation result in the
device specified by (d).
• The value to be specified in (s) is a BCD value with a maximum of 4 digits (0 to 9999).
• A BCD value from 0 to 9999.9999 is stored as the operation result in the device specified by (d).
• The operation result is a value whose 5th decimal place is rounded down.
Ladder ST
ENO:=BSQRT(EN,s,d);
ENO:=BSQRTP(EN,s,d);
FBD/LD
Instruction Execution condition
BSQRT
BSQRTP
Operand Description Range Data type Data type (label)
(s) Data used for square root operation, or the device
containing the data
0 to 9999 BCD 4-digit ANY16
(d) Start device for storing the operation result BCD 4-digit ANY16_ARRAY
(Number of elements: 2)
EN Execution condition Bit BOOL
ENO Execution result Bit BOOL
Operand Bit Word Double word Indirect
specification
Constant Others
X, Y, M, L,
SM, F, B, SB,
FX, FY
J\ T, ST, C, D, W,
SD, SW, FD, R,
ZR, RD
U\G, J\,
U3E\(H)G
Z LT, LST,
LC
LZ K, H E $
(s)
(d)
(d): Integral part
(d)+1: Decimal part
RnCPU
RnENCPU
RnSFCPU RnSFCPURnPCPURnPCPU
(Standard) (Safety)
(Redundant)
(Process)