5 basic function instructions, 1 square root instruction (sqrt) – Yaskawa MP900 Series Machine Controller New Ladder Editor User Manual

Page 95

Advertising
background image

1.5 Basic Function Instructions

1-85

1

1.5 Basic Function Instructions

1.5.1 SQUARE ROOT Instruction (SQRT)

„

Outline

The SQRT instruction calculates the square root of an integer or real number value as the
operation result. The input units and output results for integer and real number values are
different. This instruction cannot be used for double-length integer data.

Integer Type Data

The square root of Source is stored in Dest. The operation result of the SQRT instruction
slightly differs from the square root in mathematical terms. To be more precise, the opera-
tion result is expressed by the following formula:

32768

sign (A)

SQRT (|A|/ 32768)

sign (A): sign of the Source
|A| : absolute value of the Source

In other words, the operation result is equal to the mathematical square root multiplied by
approximately 181.02. If the input is a negative value, the square root of the absolute value
is calculated first and then the negative value of the square root is output as the operation
result.
The maximum error of the output value is +/-2.

Real Number Type Data

The square root of Source is stored in Dest. If the input is a negative value, the square root
of the absolute value is calculated first and then the negative value of the square root is out-
put as the operation result. This instruction can be used in a real number operation.

„

Format

Symbol: SQRT
Full Name: Square Root
Category: FUNCTION
Icon:

Advertising
This manual is related to the following products: