Mitsubishi Electronics FX3G User Manual

Page of 964
615
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
26 Character String Control – FNC200 to FNC209
26.1 FNC200 – STR / BIN to Character String Conversion
21
FNC160
-F
NC1
69
R
eal
 T
ime C
lock
 
C
ontrol
22
FNC17
0-F
NC
179
E
xternal D
evice
23
FNC
180
Alternate 
Instructions
24
FN
C181-
FNC18
9
O
thers
25
FNC190
-F
NC1
99
Bl
oc
k D
ata
 
Op
er
ation
26
FNC20
0-F
NC209
C
har
ac
te
r S
trin
Con
tro
l
27
FNC2
10-
FNC21
9
Dat
Operati
on 3
28
FNC220
-F
NC2
49
Da
ta 
C
omp
ari
son
29
FNC25
0-F
N
C
269
D
ata T
abl
Operation
30
FNC2
70-
FNC276
Ex
-Dev
ice
5) Converted character string data is stored in 
 and later as shown below.
- 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.
- 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.
- When the number of digits of the decimal 
part 
+1 is larger than the number of 
digits of 32-bit binary data stored in 
[
+1, 
], "0" (30H) is 
automatically added, and the data is shifted 
to the right end during conversion.
- 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 [
+1, 
], 
"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 32-bit binary data stored in 
[
+1, 
], an error is caused.
- "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 final 
character.
Related instructions
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is stored in
D8067.
• When the number of all digits stored in 
 is outside the following range (error code: K6706)
• When the number of digits of the decimal part stored in 
+1 is outside the following range (error code: K6706)
• When the relationship between the number of all digits stored in 
 and the number of digits of the decimal part 
stored in 
+1 does not satisfy the following (error code: K6706)
(Number of all digits -3) 
≥ Number of digits of decimal part 
• When the number of all digits stored in 
 including the digit for sign and the digit for decimal point is smaller 
than the number of digits of the binary data stored in [
+1, 
] (error code: K6706)
• When the devices 
 and later storing a character string exceeds the corresponding device range (error code: 
K6706)
Instruction
Description
ESTR (FNC116)
Converts binary floating point data into a character string (ASCII codes) with a specified number of digits.
EVAL (FNC117)
Converts a character string (ASCII codes) into binary floating point data.
VAL (FNC201)
Converts a character string (ASCII codes) into binary data.
Setting range
16-bit operation
2 to 8
32-bit operation
2 to 13
Setting range
16-bit operation
0 to 5
32-bit operation
0 to 10
   
D
  
S
2
  
S
2
1 2
6 7
10
3
12345678
3 4 5
8
Number of
all digits
Number of
digits of
decimal part
32-bit
binary data
Number of digits of
decimal part
It is automatically added.
  
S
1
  
S
1
0
1
0 5
13
10
54321
0 0 0
4
0
3 2
Number of
all digits
Number of
digits of
decimal part
16-bit
binary data
It is automatically added.
  
S
1
  
S
2
  
S
2
5
13
2
-543210
0
4 3 2
1
-
Number of
all digits
Number of
digits of
decimal part
32-bit
binary data
"20H" (space) is stored in
each digit.
  
S
1
  
S
2
  
S
2
  
S
1
  
S
2
  
S
2
  
S
1
  
S
1
  
S
1
  
S
1
  
S
1
  
S
2
  
S
2
   
D