(142)
APR
#0000
D00000
D00100
0000
00
0000
02
(142)
APR
#0001
D00010
D00200
315
5-23-7 ARITHMETIC PROCESS: APR(142)
Variations
j
APR(142)
(142)
APR
C
S
R
S: Source data
CIO, G, A, T, C, #, DM, DR, IR
R: Result word
CIO, G, A, DM, DR, IR
C: Control word
CIO, G, A, #, DM, DR, IR
Operand Data Areas
Ladder Symbol
When the execution condition is OFF, APR(142) is not executed. When the ex-
ecution condition is ON, the operation of APR(142) depends on the control word
C. If C is 0000 or 0001, APR(142) computes the sine or cosine of S. S in units of
tenths of degrees.
If C is a word address, APR(142) extrapolates the Y value for the X value in S
based on coordinates (forming line segments) entered in advance in a table be-
ginning at C.
For trigonometric functions, S must be BCD between 0000 and 0900 (between
0
°
and
90
°
). For linear extrapolation, S must be BCD when set for BCD.
C must be #0000, #0001, or a word address.
Note Refer to page 101 for general precautions on operand data areas.
Flags
ER (A50003):
For trigonometric functions, S is greater than 0900 or not BCD.
For linear extrapolation, S is not BCD when set for BCD or
the table is not readable.
Content of
*
DM word is not BCD when set for BCD.
EQ (A50006):
ON when the result is 0.
N (A50008):
Shows the status of bit 15 of the results.
The following example shows APR(142) used to calculate the sine of 30
°
. The
sine function is specified because C is #0000.
Address
Instruction
Operands
00000
LD
000000
00001
APR(142)
#0000
D00000
D00100
Source data
Result
S: D00000
R: D00100
0
10
1
10
0
10
–1
10
–1
10
–2
10
–3
10
–4
0
3
0
0
5
0
0
0
Enter input data not exceeding #0900
in BCD form.
Result data has four significant
digits, fifth
and higher digits are ignored.
The result for sin(90) will be
0.9999, not 1.
The following example shows APR(142) used to calculate the cosine of 30
°
. The
cosine function is specified because C is #0001.
Address
Instruction
Operands
00000
LD
000000
00001
APR(142)
#0000
D00010
D00200
Description
Precautions
Sine Function
Cosine Function
Special Math Instructions
Section 5-23
Summary of Contents for CVM1D
Page 462: ...SYSMAC CVM1D Duplex System Programmable Controllers Operation Manual Revised August 2001...
Page 463: ...iv...
Page 465: ...vi...