EasyManua.ls Logo

Omron CP - PROGRAMMING MANUAL 05-2007 - Page 496

Omron CP - PROGRAMMING MANUAL 05-2007
1175 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
463
Special Math Instructions Section 3-13
Cosine Function (C: #0001)
The following example shows APR(069) used to calculate the cosine of 30°.
(SIN(30) = 0.8660)
Linear Extrapolation (C: Word Address)
Using 16-bit Unsigned BCD or Binary Data
APR(069) processes the input data specified in S based on the control data in
C and the line-segment data specified in the table beginning at C+1. The
result is output to D.
•Y
n
=f(X
n
), Y
0
=f(X
0
)
Be sure that X
n–1
< X
n
in all cases.
Input all values of (X
n
, Y
n
) as binary data.
This example shows how to construct a linear extrapolation with 12 coordi-
nates. The block of data is continuous, as it must be, from D1000 to D1026 (C
to C + (2
× 12 + 2)). The input data is taken from CIO 1000, and the result is
output to CIO 1001.
S: D10 R: D200
010
1
10
0
10
–1
10
–1
10
–2
10
–3
10
–4
0300 8 6 6 0
0.00
D10
D200
Source data Result
Set the source data in 10
1
degrees.
(0000 to 0900, BCD)
Result data has four significant digits,
fifth and higher digits are ignored.
(0000 to 9999, BCD)
Word
Coordinate
C+1 Xm (max. X value)
C+2 Y
0
C+3 X
1
C+4 Y
1
C+5 X
2
C+6 Y
2
↓ ↓
C+(2m+1) X
m
(max. X value)
C+(2m+2) Y
m
Y
0
Y
2
Y
1
Y
3
Y
4
Y
m
X
0
X
1
X
2
X
3
X
4
X
m
X
Y
0.00
1000
1001
D1000
D1000 000B Hex
D1001 05F0 Hex
D1002 0000 Hex
D1003 0005 Hex
D1004 0F00 Hex
D1005 001A Hex
D1006 0402 Hex
D1025 05F0 Hex
D1026 1F20 Hex
0 0 0 0 0 0 0 0 0 0 0 0 1 0 11
15
00
x=S
X
12
Y
0
X
1
Y
1
Y
2
X
2
X
12
Y
12
Bit Bit
Content Coordinate
Output and input
both binary
(m–1 = 11: 12
coordinates)
↓↓

Table of Contents

Related product manuals