EasyManua.ls Logo

Omron CP - PROGRAMMING MANUAL 05-2007 - Page 495

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...
462
Special Math Instructions Section 3-13
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
Note If the “Floating-point specification” in bit 09 of C is set to 1, a con-
stant cannot be input for S.
Flags
Precautions 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
1
< X
2
< ... < X
m
).
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.
Examples Sine Function (C: #0000)
The following example shows APR(069) used to calculate the sine of 30
°.
Setting name Bit in C Setting
Input data (S) format 15 0: Binary
Output data (D) format 14 0: Binary
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
Name Label Operation
Error Flag 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
1
X
2
... X
m
).
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.
Equals Flag = ON if the result is 0000.
OFF in all other cases.
Negative Flag N ON if bit 15 of R is ON.
OFF in all other cases.
S: D0 R: D100
010
1
10
0
10
–1
10
–1
10
–2
10
–3
10
–4
0300 5 0 0 0
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)
0.00
D0
D100

Table of Contents

Related product manuals