Mitsubishi MELSEC Q Series Programming Manual page 632

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

Advertisement

TAN(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.
• Operation results are outside the range shown below:
0, 2
(For the Basic model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU)
• The value of the specified device is
(For the Basic model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU)
*3: There are CPU modules that will not result in an operation error if
• The result exceeds the following range (Operation results in an overflow)
(For the Universal model QCPU, LCPU)
128
2
• The value of the specified device is
(For the Universal model QCPU, LCPU)
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 32-bit floating decimal point type real numbers at
D0 and D1.
[Ladder Mode]
[List Mode]
Step
[Operations involved when X20 to X2F designate a value of 135]
X2F
0
1 3 5
BCD value
D21
32-bit floating-point
real number
7-258
-126
|operation result|
| Operation result |
Instruction
Device
D30
X20
b15
b0
Conversion to BIN
135
BIN
BCD value
Conversion to floating-point
D20
Conversion to radian
1 3 5
RAD
128
2
*3
0.
0, unnormalized number, nonnumeric, and ±
Inputs an angle used for TAN
operation (
).
1
Converts the input angle into a 32-bit
floating-point real number (
Converts the converted angle
into a radian value (
Executes TAN operation using
the converted radian value (
FLT
D11
D10
TAN operation
2 . 3 5 6 1 9 4
32-bit floating-point
TAN
real number
(Error code: 4100)
(Error code: 4100)
0 is specified. For details, refer to 3.2.4.
(Error code: 4141)
(Error code: 4140)
).
2
).
3
).
4
D1
D0
1 . 0 0 0 0 0 0
32-bit floating-point
real number
.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents