Mitsubishi MELSEC Q Series Programming Manual page 634

Common instruction 1/2
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

TAND(P)
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.
• The value of the specified device is not in the following range:
0,2
• The value of the designated device is
• The result exceeds the following range (Operation results in an overflow):
1024
2
Program Example
(1) The following program performs a TAN operation on the angle data set by the 4 BCD digits
from X20 to X2F, and stores the results as 64-bit floating decimal point type real numbers at
D0 to D3.
[Ladder Mode]
[List Mode]
Step
[Operations involved when X20 to X2F designate a value of 135]
X2F
0
BCD value
7-260
-1022
| value of specified device | < 2
| Operation result |
Instruction
Device
1
Conversion
D30
X20
b15
to BIN
1 3 5
135
BIN value
BIN
D23 D22
D21
2.356194
64-bit floating-point
real number
1024
0.
Inputs an angle used for TAN
operation (
).
1
Converts the input angle into a
64-bit floating-point real number (
Converts the converted angle into a
radian value (
).
3
Executes TAN operation using the
converted radian value (
Conversion to
2
D23 D22
b0
floating-point
64-bit floating-point
FLTD
real number
D20
D23 D22
TAN operation
4
64-bit floating-point
TAND
real number
(Error code: 4140)
(Error code: 4140)
(Error code: 4141)
).
2
).
4
D21
D20
135
Conversion to radian
3
RADD
D21
D20
-1.000000

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents