![background image](http://html1.mh-extra.com/html/omron/sysmac-c200h/sysmac-c200h_operation-manual_742423190.webp)
177
5-17-14 SQUARE ROOT – ROOT(72)
Sq: First source word (BCD)
IR, SR, AR, DM, HR, TC, LR
R: Result word
IR, AR, DM, HR, LR,
Ladder Symbols
Operand Data Areas
ROOT(72)
Sq
R
@ROOT(72)
Sq
R
When the execution condition is OFF, ROOT(72) is not executed. When the
execution condition is ON, ROOT(72) computes the square root of the
eight-digit content of Sq and Sq+1 and places the result in R. The fractional
portion is truncated.
R
Sq+1
Sq
Flags
ER:
Sq is not BCD.
Indirectly addressed DM word is non-existent. (Content of
*
DM word
is not BCD, or the DM area boundary has been exceeded.)
EQ:
ON when the result is 0.
The following example shows how to take the square root of a four-digit num-
ber and then round the result.
First the words to be used are cleared to all zeros and then the value whose
square root is to be taken is moved to Sq+1. The result, which has twice the
number of digits required for the answer (because the number of digits in the
original value was doubled), is placed in DM 0102, and the digits are split into
two different words, the leftmost two digits to IR 011 for the answer and the
rightmost two digits to DM 0103 so that the answer in IR 011 can be rounded
up if required. The last step is to compare the value in DM 0103 so that IR
011 can be incremented using the Greater Than flag.
In the following example,
√
6017 = 77.56, and 77.56 is rounded off to 78.
Description
Example
BCD Calculations
Section 5-17
Содержание SYSMAC C200H
Страница 1: ...OPERATION MANUAL C200H CPU01 E 03 E 11 E SYSMAC Programmable Controllers Cat No W130 E1 05 ...
Страница 2: ...C200H Programmable Controllers CPU01 E 03 E 11 E Operation Manual Revised June 2003 ...
Страница 3: ...iv ...
Страница 5: ...vi ...
Страница 8: ...TABLE OF CONTENTS ix Glossary 345 Index 363 Revision History 369 ...
Страница 342: ...336 Programmer Program Date Page Word Contents Notes Word Contents Notes Data Storage ...
Страница 374: ...Cat No W130 E1 05 C200H Programmable Controllers CPU01 E 03 E 11 E OPERATION MANUAL ...