Dval, Dvalp; Conversion From Character String To Bin 16-Bit Data; Conversion From Character String To Bin 32-Bit Data - Mitsubishi MELSEC-Q/L Programming Manual

Table of Contents

Advertisement

7.11.10 VAL, VALP

Conversion from character string to BIN 16-bit data

DVAL, DVALP

Conversion from character string to BIN 32-bit data

7.11.10
VAL, VALP, DVAL, DVALP
VAL, DVAL
VALP, DVALP
: Character string to be converted to BIN data or head number of the devices where the character string is stored (character string)
S
: Head number of the devices where the number of digits of the converted BIN data will be stored (BIN 16 bits)
D1
: Head number of the devices where the converted BIN data will be stored (BIN 16/32 bits)
D2
Setting
Internal Devices
Data
Bit
––
S
D1
D2
Function
VAL
(1) Converts character strings stored in the device numbers starting from that designated at
the number of digits and BIN data in
For conversions from character strings to BIN, all data from the device number designated by
where "00
" is stored will be processed as character strings.
H
b15
b8b7
S
ASCII code for the 1st character
+1
S
ASCII code for the 3rd character
+2
S
ASCII code for the 5th character
+3
S
ASCII code for the 7th character
+4
S
00
Indicates the end of character string
For example, if the character string "-123.45" is designated for the area starting from
stored at
and
in the following manner:
D1
D2
b15
b8 b7
S
31
(1)
H
S
+1
33
(3)
H
S
+2
34
(4)
H
+3
S
00
H
(2) The total number of characters that can be designated as a character string at
(3) From 0 to 5 characters from the character string designated at
However, this number must not exceed the total number of digits minus 3.
(4) The range of the numerical character string that can be converted to BIN value is from -32768 to 32767, ignoring a
decimal point.
Numerical value character strings, excluding the sign and the decimal point, can be designated only within the range
from "30
" to "39
".
H
H
The value ignoring a decimal point means:
Example
: "-12345.6"
Command
Command
R, ZR
Word
Bit
and
.
D1
D2
b0
ASCII code for the sign
ASCII code for the 2nd character
ASCII code for the 4th character
ASCII code for the 6th character
Sign 1st
H
char-
acter
b0
2D
( )
H
32
(2)
H
2E
(.)
H
35
(5)
H
"-123456"
VAL, VALP, DVAL, DVALP
Ver.
High
Basic
performance
• Basic model QCPU: The serial number (first five digits) is
"04122" or later.
(Compatible GX Developer: Version 8.00A or later)
indicates an instruction symbol of VAL/DVAL.
S
P
S
J
\
U
\G
Word
––
––
Total number
D1
of digits
Number of digits
+1
D1
in decimal fraction
Integer value
.
ignoring decimal
D2
point
2nd
7th
BIN 16 bits
char-
char-
acter
acter
D1
+1
D1
1 2 3 4 5
D2
1 2 3
.
4 5
S
can become the decimal fraction part.
S
Process
LCPU
Redundant Universal
D1
D2
D2
D1
Constants
Zn
$
––
––
to BIN 16-bit data, and stores
S
to the device number
S
, the operation result would be
S
7
2
is from 2 to 8.
1
2
3
4
Other
4
––
––
6
––
7
8
469

Advertisement

Table of Contents
loading

Table of Contents