Omron SYSMAC CP Series Instruction & Reference Manual page 259

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

Floating-point Data
Sample program
Sine Function (C: #0000)
The following example shows APR(069) used to calculate the sine of 30°.
(SIN(30) = 0.5000)
0.00
#0000
Cosine Function (C: #0001)
The following example shows APR(069) used to calculate the cosine of 30°.
(COS(30) = 0.8660)
0.00
APR
#0001
D010
D200
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.
CP1E CPU Unit Instructions Reference Manual(W483)
Source data
S: D0
APR
1
0
×10
0
3
D000
D100
Set the source data in ×10
(0000 to 0900, BCD)
Source data
S: D10
1
0
×10
0
3
Set the source data in ×10 –1 degrees.
(0000 to 0900, BCD)
Setting name
Input data (S) format
Output data (D) format
Source data form
Signed data specification for S
and D
Data length specification for S
and D
Floating-point specification
Note If the "Floating-point specification" in bit 09 of C is set to 1, a constant
cannot be input for S.
0
–1
–1
×10
×10
×10
0
0
5
–1
Result data has four significant digits,
degrees.
fifth and higher digits are ignored.
(0000 to 9999, BCD)
0
–1
–1
×10
×10
×10
0
0
8
Result data has four significant digits,
fifth and higher digits are ignored.
(0000 to 9999, BCD)
Y
Y
m
Y
4
Y
3
Y
1
Y
2
Y
0
X
X
X
X
0
1
2
3
2 Instructions
Bit in C
Setting
15
0
14
0
13
0
0
11
0
10
09
1: Floating-point data
Result
R: D100
–2
–3
–4
×10
×10
×10
0
0
0
Result
R: D100
–2
–3
–4
×10
×10
×10
6
6
0
X
X
X
4
m
2
2-223

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents