Mitsubishi MELSEC-Q/L Programming Manual page 507

Table of Contents

Advertisement

Function
(1) The COS (cosine) value of the angle specified by
(2) Angles designated at
S
For conversion between degrees and radian values, see the RADD and DEGD instructions.
(3) When the operation results in -0 or an underflow, the result is processed as 0.
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
Error
code
The specified device value is not within the following range:
-102
4140
0, 2
| Specified device value | < 2
The specified device value is -0.
The operation result exceeds the following range (when an overflow
occurs):
4141
1024
2
| Operation result |
Program Example
(1) The following program performs a COS operation on the angle data designated by the 4 BCD digits from X20 to X2F, and
stores results as 64-bit floating decimal point type real numbers at D0 to D3.
[Ladder Mode]
[List Mode]
Step
Instruction
S
S
+3
S
+2
S
+1
S
COS (
64-bit floating-point
real number
are set in radian units (degrees
Error details
1024
Inputs an angle used for
COS operation (
Converts the input angle into a
64-bit floating-point real number (
Converts the converted angle
into a radian value (
Executes COS operation using the
converted radian value (
Device
is calculated and its result is stored into the device specified by
D
+3
D
+2
D
)
64-bit floating-point
real number
/ 180).
Q00J/
Q00/
QnH
Q01
––
––
––
––
).
1
).
2
).
3
).
4
COSD, COSDP
+1
D
QnPH QnPRH
QnU
––
––
––
––
1
.
D
2
3
4
4
LCPU
6
7
8
505

Advertisement

Table of Contents
loading

Table of Contents