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

Table of Contents

Advertisement

7.11.9
STR, STRP

Conversion from BIN 16-bit data to character string

DSTR, DSTRP

Conversion from BIN 32-bit data to character string

7.11.9
STR, STRP, DSTR, DSTRP
STR, DSTR
STRP, DSTRP
: Head number of the devices where the digits numbers for the numerical value to be converted are stored (BIN 16 bits)
S1
: BIN data to be converted (BIN 16/32 bits)
S2
: Head number of the devices where the converted character string will be stored (character string)
D
Internal Devices
Setting
Data
Bit
S1
D2
––
D
Function
STR
(1) Adds a decimal point to the BIN 16-bit data designated by
character string data, and stores it in the area starting from the device number designated by
S1
Total number of digits
Number of digits in decimal fraction
S1
BIN data
S2
5
S1
+1
S1
1
1 2 3
S2
(2) The total number of digits that can be designated by
(3) The number of digits that can be designated by
However, the number of digits following the decimal point must be smaller than or equal to the total number of digits
minus 3.
(4) BIN data in the range between -32768 and 32767 can be designated at
(5) After conversion, character string data is stored at the device number
(a) The sign "20
" (space) will be stored if the BIN data is positive, and the sign "2D
H
negative.
Command
Command
R, ZR
Word
Bit
D
D
.
D
Sign
D
D
b15
D
D
1 2
3
+1
.
D
+2
+1 as a part of the decimal fraction is from 0 to 5.
S1
STR, STRP, DSTR, DSTRP
Ver.
High
Basic
performance
• Basic model QCPU: The serial number (first five digits) is
"04122" or later.
indicates an instruction symbol of STR/DSTR.
S1
S1
P
J
\
U
\G
Word
––
at the location designated by
S2
b15
b8b7
ASCII code for the
(total number of digits -1)
ASCII code for the sign
th digit
ASCII code for the
ASCII code for the
(total number of digits -3)
(total number of digits -2)
th digit
th digit
ASCII code for the
ASCII code for the
(total number of digits -5)
(total number of digits -4)
th digit
th digit
ASCII code for the
ASCII code for the
(total number of digits -7)
(total number of digits -6)
th digit
th digit
00
H
Automatically stored at
the end of the character string
b8
b7
31
(1)
2D
( )
H
2E
(.)
32
(2)
H
H
00
33
(3)
H
H
is from 2 to 8.
S1
.
S2
or later device number as indicated below:
D
Process
Redundant Universal
LCPU
S2
D
S2
D
Constants
Zn
Other
K, H
––
––
, converts the data to
S1
.
D
b0
Designated total
number of digits
b0
" (minus sign) will be stored if it is
H
1
2
3
4
4
––
––
6
––
7
8
465

Advertisement

Table of Contents
loading

Table of Contents