Sample program, 2 instructions, Sine function (c: #0000) – Omron SYSMAC CP CP1E-N@@D@-@ User Manual
Page 259: Cosine function (c: #0001)
2-223
2 Instructions
CP1E CPU Unit Instructions Reference Manual(W483)
Special
Math I
n
stru
ctio
ns
2
APR
Sample program
Sine Function (C: #0000)
The following example shows APR(069) used to calculate the sine of 30
°.
(SIN(30) = 0.5000)
Cosine Function (C: #0001)
The following example shows APR(069) used to calculate the cosine of 30
°.
(COS(30) = 0.8660)
Floating-point Data
Linear Extrapolation (C: Word Address)
• Using 16-bit Unsigned BCD or Binary Data
APR(069) processes the input data speci-
fied 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.
Note If the “Floating-point specification” in bit 09 of C is set to 1, a constant
cannot be input for S.
Setting name
Bit in C
Setting
Input data (S) format
15
0
Output data (D) format
14
0
Source data form
13
0
Signed data specification for S
and D
11
0
Data length specification for S
and D
10
0
Floating-point specification
09
1: Floating-point data
S: D0
R: D100
0
Ч10
1
Ч10
0
Ч10
–1
Ч10
–1
Ч10
–2
Ч10
–3
Ч10
–4
0
3
0
0
5
0
0
0
APR
#0000
D000
D100
0.00
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)
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)
APR
#0001
D010
D200
0.00
S: D10
R: D100
0
Ч10
1
Ч10
0
Ч10
–1
Ч10
–1
Ч10
–2
Ч10
–3
Ч10
–4
0
3
0
0
8
6
6
0
Y
m
Y
4
Y
3
Y
1
Y
2
Y
0
X
0
X
1
X
2
X
3
X
4
X
m
X
Y