2 cosine (cos), 1) overview, 2) format – Yaskawa MP2000 Series: User's Manual for Motion Programming User Manual
Page 245: 3) programming examples
8 Command Reference
8.9.2 Cosine (COS)
8-138
8.9.2 Cosine (COS)
(1) Overview
The cosine command (COS) returns the cosine of integer or real number data as the operation result.
Double integer data cannot be used.
(2) Format
* The input units and output results are different for integer and real number data.
• Integer Data
Integer data can be used within a range of -327.68 to 327.67 degrees. The immediately preceding opera-
tion result (integer data) is used as input, and the operation result is returned in an integer register (input
unit 1 = 0.01 degrees). The operation result is multiplied by 10000 before being output.
• Real Number Data
The command uses the immediately preceding operation result (real number data) as input, and returns
the cosine in a real number register (unit = degrees).
If integer data is input outside the range of -327.68 to 327.67 degrees, a correct result cannot be obtained.
(3) Programming Examples
COS command programming examples are shown below.
Motion Programs
Sequence Programs
Applicable
Applicable
MW00100 = COS (3000);
A B
Item Description
Unit
Usable Registers
A
Cosine val-
ue output
–
• All integer and real number type registers (Excluding # and C registers)
• The above registers with subscript
• Subscript registers
B
Angle input
Degree
(
°)
∗
• All integer and real number type registers (Excluding # and C registers)
• The above registers with subscript
• Subscript registers
• Constants
Example:
Integer Data
Real Number Data
MW00102 = COS ( MW00100 ) ;
Equivalent
(05000)
(06000)
0.5=COS60°
=>
MF00102 = COS ( MF00100 ) ;
(0.5)
(60.0)
IMPORTANT
Type
Motion Programs/
Sequence Programs
Ladder Programs
B
−
−
W
MW00102=COS(MW00100);
L
−
−
F
DF00202=COS(DF00200);
EXAMPLE