Floating To 16-Bit: Fix(450) - Omron SYSMAC CJ - REFERENCE MANUAL 08-2008 Reference Manual

Programmable controllers
Hide thumbs Also See for SYSMAC CJ - REFERENCE MANUAL 08-2008:
Table of Contents

Advertisement

Floating-point Math Instructions

3-15-1 FLOATING TO 16-BIT: FIX(450)

Purpose
Ladder Symbol
Variations
594
Calculations
2
2
Distance r =
+
y
y -- -
1
Angle
= tan
DM Contents
x
D00000
#0100
(BCD)
y
D00001
#0100
(BCD)
1. This section of the program converts the data from BCD to floating-point.
a) The data area from D00200 onwards is used as a work area.
b) First BIN(023) is used to temporarily convert the BCD data to binary
data, and then FLT(452) is used to convert the binary data to floating-
point data.
c) The value of x that has been converted to floating-point data is output
to D00203 and D00202.
d) The value of y that has been converted to floating-point data is output
to D00205 and D00204.
2. In order to find the distance r, Floating-point Math Instructions are used to
calculate the square root of x
D00212 as floating-point data.
3. In order to find the angle , Floating-point Math Instructions are used to
–1
calculate tan
(y/x). ATAN(465) outputs the result in radians, so DEG(459)
is used to convert to degrees. The result is then output to D00219 and
D00218 as floating-point data.
4. The data is converted back from floating-point to BCD.
a) First FIX(450) is used to temporarily convert the floating-point data to
binary data, and then BCD(024) is used to convert the binary data to
BCD data.
b) The distance r is output to D00100.
c) The angle
is output to D00101.
Converts a 32-bit floating-point value to 16-bit signed binary data and places
the result in the specified result word.
FIX(450)
S
R
Variations
Executed Each Cycle for ON Condition
Executed Once for Upward Differentiation
Executed Once for Downward Differentiation Not supported.
Immediate Refreshing Specification
Examples
Distance r =
Angle
= tan
0 1 4 1
D00100
(BCD)
0 0 4 5
D00101
(BCD)
2
2
+y
. The result is then output to D00213 and
S: First source word
R: Result word
Section 3-15
2
2
100
+
100
=
141.4214
100
1
--------- -
180
=
45.0
100
r
FIX(450)
@FIX(450)
Not supported.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SYSMAC CJ - REFERENCE MANUAL 08-2008 and is the answer not in the manual?

This manual is also suitable for:

Sysmac cs seriesSysmac one nsj seriesSysmac cj series

Table of Contents

Save PDF