313
Special Math Instructions Section 5-22
5-22-5 ARITHMETIC PROCESS – APR(––)
Limitations This instruction is available in the CQM1 only.
For trigonometric functions S must be BCD from 0000 to 0900 (0°≤ θ ≤ 90°).
DM 6144 to DM 6655 cannot be used for D.
Description When the execution condition is OFF, APR(––) is not executed. When the exe-
cution condition is ON, the operation of APR(––) depends on the control word
C.
If C is #0000 or #0001, APR(––) computes sin(
θ) or cos(θ)*. The BCD value of
S specifies
θ in tenths of degrees.
If C is an address, APR(––) computes f(x) of the function entered in advance
beginning at word C. The function is a series of line segments (which can
approximate a curve) determined by the operator. The BCD or hexadecimal
value of S specifies x.
Flags ER: Indirectly addressed DM word is non-existent. (Content of *DM word
is not BCD, or the DM area boundary has been exceeded.)
For trigonometric functions, x > 0900. (x is the content of S.)
A constant other than #0000 or #0001 was designated for C.
The linear approximation data is not readable.
EQ: The result is 0000.
Examples
Sine Function The following example demonstrates the use of the APR(––) sine function to
calculate the sine of 30
°. The sine function is specified when C is #0000.
C: Control word
IR, SR, AR, DM, HR, TC, LR, #
S: Input data source word
IR, SR, AR, DM, HR, TC, LR
Operand Data Areas
D: Result destination word
IR, SR, AR, DM, HR,TC, LR
Ladder Symbols
APR(––)
C
S
D
@APR(––)
C
S
D
APR(––)
#0000
DM 0000
DM 0100
00000
Enter input data not exceed-
ing #0900 in BCD.
Result data has four significant
digits, fifth and higher digits are
ignored. The result for sin(90) will
be 0.9999, not 1.
Input data, x Result data
S: DM 0000 D: DM 0100
010
1
10
0
10
–1
10
–1
10
–2
10
–3
10
–4
0300 5 0 0 0
Address Instruction Operands
00000 LD 00000
00001 APR(––)
# 0000
DM 0000
DM 0100