Mitsubishi MELSEC-Q/L Programming Manual page 525

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
4100
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 converts the radian value set with 32-bit floating decimal point type real number at D20 and D21
to angles, and stores the result as a BCD value at Y40 to Y4F.
[Ladder Mode]
[List Mode]
Step
Instruction
[Operations involved when the values at D20 and D21 are 1.435792]
Conversion
D21
D20
to angle
1 . 4 3 5 7 9 2
32-bit floating-point
DEG
real number
7.12.16 DEGD, DEGDP
Conversion from floating-point radian to angle
(Double precision)
7.12.16
DEGD, DEGDP
DEGD
DEGDP
: Radian angle to be converted to degrees or head number of the devices where the radian angle is stored (real number)
S
: Head number of the devices where the value converted in degrees will be stored (real number)
D
Setting
Internal Devices
Data
Bit
Word
––
S
––
D
Error details
*2
Converts a radian value into
an angle (
1
Converts the angle in
32-bit floating-point real
number into an integer (
Outputs the converted integer
to a display device (
Device
Conversion
D11
D10
to BIN
8 2 . 2 6 4 8 2
32-bit floating-point
BIN
real number
Command
Command
J
\
R, ZR
Bit
Word
Q00J/
Q00/
QnH
Q01
––
––
––
––
)
)
2
)
3
D0
BCD operation
b15
b0
82
BIN value
BCD
High
Basic
Process
performance
DEGD
S
DEGDP
S
Zn
U
\G
––
––
DEGD, DEGDP
QnPH QnPRH
QnU
LCPU
––
––
––
––
––
––
Y4F
Y40
0 0 8 2
BCD value
Redundant
Universal
LCPU
D
D
Constants
Other
E
––
––
––
523
1
2
3
4
4
6
7
8

Advertisement

Table of Contents
loading

Table of Contents