Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 509

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Floating-point Math Instructions
Example
476
The Equals Flag will only turn ON when both the exponent (e) and the man-
tissa (f) are zero after a calculation. A calculation result will also be output as
zero when the absolute value of the result is less than the minimum value that
can be expressed for floating-point data. In that case the Underflow Flag will
turn ON.
In this program example, the X-axis and Y-axis coordinates (x, y) are provided
by 4-digit BCD content of D0 and D1. The distance (r) from the origin and the
angle ( , in degrees) are found and output to D100 and D101. In the result,
everything to the right of the decimal point is truncated.
y
r
0
x
P (100, 100)
Section 3-14

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents