453
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Special Math Instructions
3
APR
APR
Applicable Program Areas
Operands
z Sine Function
z Cosine Function
Instruction Mnemonic Variations
Function
code
Function
ARITHMETIC PROCESS APR @APR 069
Calculates the sine, cosine, or a linear extrapola-
tion of the source data.
Symbol
APR
Area
Function block
definitions
Block program areas Step program areas Subroutines Interrupt tasks
SFC action or
transition programs
Usage OK OK OK OK OK OK
Operand Description Data type Size
C Control word UINT Variable
S Source data WORD 1
R Result word WORD 1
• Sine Function (C=0000)
When C is 0000, APR(069) calculates the SIN(S) and writes
the result to R. The range for S is 0000 to 0900 BCD (0.0° to
90.0
°) and the range for R is 0000 to 9999 BCD (0.0000 to
0.9999). The remainder of the result beyond the fourth deci-
mal place is eliminated.
• Cosine Function (C=0001)
When C is 0001, APR(069) calculates the COS(S) and writes
the result to R. The range for S is 0000 to 0900 BCD (0.0
° to
90.0
°) and the range for R is 0000 to 9999 BCD (0.0000 to
0.9999). The remainder of the result beyond the fourth deci-
mal place is eliminated.
Note The actual result for SIN(90
°) and COS(0°) is 1, but 9999 (0.9999) will be output to R.
C: Control word
S: Source word
R: Result word
APR(069)
C
S
R
Operand Value Data range
C 0000 hex ---
S
0000 to 0900 (BCD)
0
° to 90°
R
0000 to 0900 (BCD)
9999 (BCD)
0.0000 to 0.9999
1.0000
Operand Value Data range
C 0001 hex ---
S
0000 to 0900 (BCD)
0
° to 90°
R
0000 to 0900 (BCD)
9999 (BCD)
0.0000 to 0.9999
1.0000