7-192
7.11 String Processing Instructions
7.11.10 Character string data to 16-/32-bit BIN data conversion
VAL, DVAL
(8) In cases where the character string specified for
contains 20
H
(space) or 30
H
(0) between
the sign and the first numeric value other than 0, these 20
H
and 30
H
are ignored in the
conversion to BIN value.
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 number of characters in the character string specified for
is outside of the ranges
shown below.
(Error code: 4100)
When VAL(P) instruction is in use .................... 2 to 8 characters
When DVAL(P) instruction is in use .................. 2 to 13 characters
• The number of characters for decimal fraction of the character string
specified for falls outside the ranges shown below.
(Error code: 4100)
When VAL(P) instruction is in use .................... 0 to 5 characters
When DVAL(P) instruction is in use .................. 0 to 10 characters
• The total number of characters of the character string specified for
and the number of
characters for decimal fraction stand in a relationship that is outside of the range
indicated below.
(Error code: 4100)
Total number of characters minus 3 is equal to or greater than the number of characters
for decimal fraction.
• ASCII code other than 20
H
or 2D
H
has been set for the sign.
(Error code: 4100)
• ASCII code other than from 30
H
to 39
H
or 2E
H
(decimal point) has been set for digits of
each number.
(Error code: 4100)
• There has been more than one decimal point set in the value.
(Error code: 4100)
• The value of the BIN value when converted falls outside of the following ranges.
(Error code: 4100)
When VAL(P) instruction is in use .................... 32768 to 32767
When DVAL(P) instruction is in use .................. 2147483648 to 2147483647
• No 00
H
is set within the range from the device number specified for
to the last device
number of the corresponding device.
(Error code: 4101)
s
6 5
4
3
.
2 1
Ignore
d
12
2
Total num
b
er of
d
igits
Num
b
er of
d
igits
in
d
ecimal fraction
BIN
d
ata
0
0 0 0 5
4
3 2 1
Ignore
d
11
8
.
S
ign
6 5
4
3 2 1
5
4
3 2 1
Total num
b
er of
d
igits
Num
b
er of
d
igits
in
d
ecimal fraction
BIN
d
ata
s
s
s
s
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......