Omron SYSMAC CJ - REFERENCE MANUAL 01-2008 Reference Manual page 618

Sysmac cs/cj/one nsj series programmable controllers
Table of Contents

Advertisement

Special Math Instructions
Flags
Precautions
Examples
Name
Label
Error Flag
ER
Equals Flag
=
Negative Flag
N
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: D00000
1
0
0
10
10
0
3
0
Set the source data in 10
(0000 to 0900, BCD)
Cosine Function (C: #0001)
The following example shows APR(069) used to calculate the cosine of 30 .
(SIN(30) = 0.8660)
Source data
S: D00010
1
0
0
10
10
0
3
0
Set the source data in 10
(0000 to 0900, BCD)
Operation
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
X
1
2
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.
ON if bit 15 of R is ON.
OFF in all other cases.
< X
< ... < X
< S< X
1
2
n
n+1
Result
R: D00100
–1
–1
–2
10
10
10
0
5
0
–1
Result data has four significant digits,
degrees.
fifth and higher digits are ignored.
(0000 to 9999, BCD)
Result
R: D00200
–1
–1
–2
10
10
10
0
8
6
–1
degrees.
Result data has four significant digits,
fifth and higher digits are ignored.
(0000 to 9999, BCD)
Section 3-14
...
X
).
m
).
–3
–4
10
10
0
0
–3
–4
10
10
6
0
579

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents