7.11 String Processing Instructions
7.11.19 BCD format to floating-point data conversion
7-227
7
APPLI
C
A
T
IO
N
INSTRUCTIONS
EREX
P
EREXP
(3) 0 to 38 can be set for the BCD exponent of
+4.
(4) 0 to 7 can be set for the decimal fraction digits of
.
O
peration Error
In any of the following cases, an operation error occurs, the error flag (SM0) is turned ON, and
the corresponding error code is stored to SD0.
• The format specified for
is neither 0 nor 1.
(Error code: 4100)
• The BCD data specified for
+1 and
+2 exceeds 8 digits.
(Error code: 4100)
• The format specification specified for
+3 is other than 0 or 1.
(Error code: 4100)
• The exponent data specified for
+4 is outside the range of 0 to 38.
(Error code: 4100)
• The decimal fraction digits specified for
is outside the range of 0 to 7.
(Error code: 4100)
• The device specified for
exceeds the corresponding device range. (For Universal
model QCPU only)
(Error code: 4101)
Program Example
In the following program, the floating-point data in BCD format stored in Var_D0 and the following
devices are converted to the floating-point real number data based on the decimal fraction digits
stored in Var_D10 when X0 turns ON, and the result is stored to Var_D100.
[Structured ladder]
[ST]
D10:=3;
EREXPP(X0,Var_D0,Var_D10,Var_D100);
[Operation]
s
1
s
2
s
1
s
1
s
1
s
1
s
1
s
2
B
C
D
t
y
pe
f
l
oat
i
ng
-
po
i
nt
format
1
5423
H
0321
H
0
2
+4
+3
+2
+1
6
(N
um
b
er
of
di
g
i
ts
i
n
d
ec
i
ma
l
fract
i
on
)
(Si
gn
)
H3215423 (
B
C
D
7 di
g
i
ts
)
(Si
gn
(
exponent
part
))
(
B
C
D
exponent
)
d
3 . 2 1 5 4 2 3 E+ 2
s
1
s
1
s
1
s
1
s
1
s
2
s
1
Var
_
D
0
Var
_
D
10
1
4567
H
0123
H
1
3
3
1234567
H
(
B
C
D
7 di
g
i
ts
)
Var
_
D
100
1. 2 3 4 5 6 7
Содержание MELSEC Q Series
Страница 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Страница 2: ......
Страница 14: ...A 12 MEMO ...
Страница 340: ...6 178 MEMO MTR ...
Страница 708: ...7 368 MEMO ...
Страница 776: ...8 68 MEMO ...
Страница 796: ...9 20 MEMO ...
Страница 804: ...App 8 MEMO ...
Страница 812: ...Index 8 MEMO ...
Страница 815: ......