Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
26 Applied Instructions (Character String Control)
26.1 STR / BIN to Character String Conversion
620
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
5) Converted character string data is stored in and later as shown below.
a) For the sign, "space" (20H) is stored when the 32-bit binary data stored in is positive, and "-"
(2DH) is stored when the 32-bit binary data stored in is negative.
b) When the number of digits of the
decimal part + 1 is set to any
value other than "0", the decimal point
"." (2EH) is automatically added in
"number of digits of decimal part + 1"th
digit.
When the number of digits of the
decimal part + 1 is set to "0", the
decimal point is not added.
c) When the number of digits of the
decimal part + 1 is larger than
the number of digits of 32-bit binary
data stored in , "0" (30H) is
automatically added, and the data is
shifted to the right end during
conversion.
d) When the number of all digits stored in
excluding the sign and decimal
point is larger than the number of
digits of 32-bit binary data stored in
, "space" (20H) is stored in each
digit between the sign and the numeric
value.
When the number of all digits stored in
excluding the sign and decimal
point is smaller than the number of
digits of binary data stored in , an
error is caused.
e) "00H" indicating the end of a character string is automatically stored at the end of a converted
character string.
When the number of all digits is even, "0000H" is stored in the device after the last character.
When the number of all digits is odd, "00H" is stored in the high-order byte (8 bits) of the device storing
the last character.
Cautions
1) The instruction is provided in the FX3UC PLC Ver. 2.20 or later.
Related instruction
Instruction Description
DESTR Converts binary floating point data into a character string (ASCII codes) with a specified number of digits.
DEVAL Converts a character string (ASCII codes) into binary floating point data.
VAL Converts a character string (ASCII codes) into binary data.
12 6
Number of
digits of
decimal part
Number of
all digits
7
It is automatically added.
Number of digits
of decimal part
32-bit
binary data
10
3
12345678
345 8
010
Number of
all digits
5
It is automatically added.
Number of digits
of decimal part
32-bit
binary data.
13
10
54321
000 4032
2
Number of
all digits
Number of digits
of decimal part
32-bit
binary data
13
2
-543210
0543 1
"20H" (space) is stored
in each digit
-