Mitsubishi MELSEC-Q/L Programming Manual page 473

Table of Contents

Advertisement

(8) In cases where the character string designated by
numerical value other than "0", these "20
6 5 4 3 .
2 1
Ignored
0
.
0 0 0 5 4 3 2 1
Sign
Ignored
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 number of characters in the character string specified by
outside the following ranges:
When VAL instruction is in use........2 to 8
When DVAL instruction is in use.....2 to 13
The number of characters in the decimal fraction portion of the
character string specified by
When VAL instruction is in use........0 to 5
When DVAL instruction is in use.....0 to 10
The total number of characters in the character string specified by
and the number of characters in the decimal fraction part stand in a
4100
relationship that is outside the following ranges:
Total number of characters -3
fraction part
An ASCII code other than "20
An ASCII code other than "30
been set as a digit for one of the individual numbers.
There has been more than one decimal points set in the value.
The converted BIN value exceeds the following ranges:
When the VAL instruction is in use........-32768 to 32767
When the DVAL instruction is in use.....-2147483648 to 2147483647
No "00
" is set within the range from the device number specified by
H
4101
to the last device number of the corresponding device.
Program Example
(1) The following program reads the character string data stored from D20 to D22 as an integer, converts it to a BIN value,
and stores it at D0 when X0 is ON.
[Ladder Mode]
contains "20
S
" and "30
" are ignored in the conversion into a BIN value.
H
H
Total number of digits
12
Number of digits
2
in decimal fraction
BIN data
6 5 4 3 2 1
Total number of digits
11
Number of digits
8
in decimal fraction
5 4 3 2 1
BIN data
Error details
is outside the following ranges:
S
Number of characters in the decimal
" or "2D
" has been set for the sign.
H
H
" to "39
" or "2E
" (decimal point) has
H
H
H
[List Mode]
Step
VAL, VALP, DVAL, DVALP
" (space) or "30
" (0) between the sign and the first
H
H
Q00J/
Q00/
QnH
QnPH QnPRH
Q01
is
S1
S
S
Instruction
Device
1
2
3
4
4
QnU
LCPU
6
7
8
471

Advertisement

Table of Contents
loading

Table of Contents