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

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Special Math Instructions
Flags
Precautions
Examples
0.00
462
Note If the "Data length specification for S and D" in bit 10 of C is set to
1 and a 16-bit constant is input for S, the input data will be convert-
ed to 32-bit signed binary before the linear extrapolation calcula-
tion.
• Floating-point Data
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 con-
stant cannot be input for S.
Name
Error Flag
Equals Flag
Negative Flag
The actual result for SIN(90 ) and COS(0 ) is 1, but 9999 (0.9999) will be out-
put to R.
An error will occur if C is a constant greater than 0001.
An error will occur if linear extrapolation is specified but the X coordinates are
not in ascending order (X
An error will occur if linear extrapolation is specified and BCD input is speci-
fied (bit 15 of C ON) but S is not BCD.
An error will occur if a trigonometric function is specified (C=0000 or 0001) but
S is not BCD between 0000 and 0900.
Sine Function (C: #0000)
The following example shows APR(069) used to calculate the sine of 30 .
Source data
S: D0
1
0
10
0
3
D0
D100
Set the source data in 10
(0000 to 0900, BCD)
15
14
13
11
10
09
Label
ER
ON if C is a constant greater than 0001.
ON if C is a word address but the X coordinates are not in
ascending order (X
ON if C is a word address and bits 9, 11, and 15 of C indi-
cate BCD input, but S is not BCD.
ON if C is a word address and bit 9 of C indicates floating-
point data, but S is a one-word constant.
ON if C is 0000 or 0001 but S is not BCD between 0000
and 0900.
OFF in all other cases.
=
ON if the result is 0000.
OFF in all other cases.
N
ON if bit 15 of R is ON.
OFF in all other cases.
< X
< ... < X
1
2
m
0
–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)
Section 3-13
Bit in C
Setting
0: Binary
0: Binary
0
0
0
1: Floating-point data
Operation
X
...
X
).
1
2
m
).
Result
R: D100
–1
–2
–3
–4
10
10
10
0
0
0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents