Mitsubishi MELSEC-Q/L Programming Manual page 509

Table of Contents

Advertisement

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:
-126
4100
0, 2
| Specified device value | < 2
The specified device value is -0.
The specified device value is -0, unnormalized number, nonnumeric,
4140
and ±
.
The operation result exceeds the following range (when an overflow
occurs):
4141
128
2
| Operation result |
*2:
There are CPU modules that will not result in an operation error if -0 is specified.
For details, refer to Page 88, Section 3.2.4.
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
Instruction
[Operations involved when X20 to X2F designate a value of 135]
X2F
X20
Conversion to BIN
0
1 3 5
BCD value
BIN
D21
D20
Conversion to radian
1 3 5
32-bit floating-point
real number
Error details
128
*2
Inputs an angle used for TAN
operation (
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 (
Device
D30
b15
b0
135
BCD value
Conversion to floating-point
FLT
D11
D10
2 . 3 5 6 1 9 4
RAD
32-bit floating-point
real number
Q00J/
Q00/
QnH
Q01
––
––
––
––
).
1
).
2
).
3
).
4
D1
D0
TAN operation
1 . 0 0 0 0 0 0
TAN
32-bit floating-point
real number
TAN, TANP
QnPH QnPRH
QnU
LCPU
––
––
––
––
––
––
507
1
2
3
4
4
6
7
8

Advertisement

Table of Contents
loading

Table of Contents