5
Categories and Use of Basic Application Instructions
DVP-PM Operation Instruction
5-112
API Mnemonic
Operands
Function
131
D COS P
Cosine
Controllers
20PM
10PM
Bit Devices
Word Devices
Program Steps
Type
OP
X Y M S F H
KnX
KnY KnM KnS T
C
D
V
Z
S
*
*
D
*
DCOS, DCOSP: 6 steps
Operands:
S
: Source device (0
°≦
S
<
360
°
)
D
: Operation result
Explanations:
1. COS instruction performs cosine operation on
S
and stores the result in
D
2. F refers to floating point input. Be sure to add a decimal point when using it.
3. Only 32-bit instructions DCOS and DCOSP are applicable.
4. The value in
S
can be set as radian or degree by Radian/Degree selection flag
M1760/M1920 = OFF indicates radian mode. RAD = degree
×π
/180.
M1760/M1920 = ON indicates degree mode. Degree range: 0
°≦
degree
<
360
°
5. If the result = 0, zero flag will be ON.
6. Flags:
OX
O100
Zero flag
M1808
M1968
Radian/Degree flag
M1760
M1920
7. See the figure below for the relation between the radian and the operation result:.
R
S
-2
3
2
-2
2
3
2
2
2
-
1
-1
0
-
S: Radian
R: Result (COS value)
Program Example 1:
Radian/degree selection flag = OFF indicates radian mode. When X0 = ON, DCOS instruction conducts cosine
operation on binary floating value in (D1, D0) and stores the COS value in (D11, D10) in binary floating format.
M1002
RST
X0
DCOS
D0
D10
Degree/radian
flag
D 1
D 0
D 1
D 10
COS value
binary floating point
RAD value (Degree
180)
binary floating point
/
X
π
Program Example 2:
Radian/degree selection flag = ON indicates degree mode. When X0 = ON, DCOS instruction performs cosine
Summary of Contents for DVP-10PM
Page 1: ......
Page 45: ...2 Hardware Specifications and Wiring DVP PM Application Manual 2 30 MEMO...
Page 125: ...3 Functions of Devices in DVP PM DVP PM Application Manual 3 80 MEMO...
Page 341: ...8 Application Examples DVP PM Application Manual 8 2 Trajectory 3 Trajectory 4...
Page 427: ...9 Electrical CAM DVP PM Application Manual 9 74...
Page 437: ...10 Encrypting User Program DVP PM Application Manual 10 10 MEMO...
Page 458: ...11 G code Application DVP PM Application Manual 11 21 B O100 main program...
Page 561: ...14 Appendix DVP PM Application Manual 14 4 MEMO...