Mitsubishi Electronics FX3G User Manual
613
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
69
R
eal
T
T
ime C
lock
C
ontrol
22
FNC17
0-F
NC
179
179
E
xternal D
evice
23
FNC
180
Alternate
Instructions
24
FN
C181-
FNC18
9
O
thers
25
FNC190
-F
NC1
99
99
Bl
oc
k D
ata
ata
Op
er
er
ation
26
FNC20
0-F
NC209
C
har
ac
te
r S
trin
g
Con
tro
tro
l
27
FNC2
10-
FNC21
10-
FNC21
9
Dat
a
a
Operati
on 3
28
FNC220
-F
NC2
49
49
Da
ta
C
omp
ari
ari
son
29
FNC25
0-F
N
C
269
D
ata T
abl
e
e
Operation
30
FNC2
70-
FNC276
FNC276
Ex
-Dev
ice
Explanation of function and operation
1. 16-bit operation (STR and STRP)
1) All digits (specified by
) of 16-bit binary data stored in
are converted into ASCII codes while the
decimal point is added to the position specified by the device storing the number of digits of the decimal part
(
(
+1), and stored in
and later.
2) Set the number of all digits
ranging from 2 to 8.
3) Set the number of digits of the decimal part
+1 ranging from 0 to 5.
Make sure to satisfy "Number of digits of decimal part <= (Number of all digits -3)".
4) 16-bit binary data to be converted stored in
should be ranging from -32768 to +32767.
5) Converted character string data is stored in
and later as shown below.
- As the sign, "space" (20H) is stored when the 16-bit binary data stored in
is positive, and "-" (2DH) is
stored when the 16-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
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 16-bit binary data stored in
, "0" (30H) is automatically added,
and the data is shifted to the right end
during conversion.
during conversion.
S
1
S
2
S
1
D
Command
input
FNC200
STR
S
2
S
1
D
5
1
1
- 1 2
3
S
1
+0
+1
+1
b15
+0
+2
b8 b7
b0
00H is automatically stored at the
end of a character string.
D
S
2
+1
For number of
all digits
=5
S
1
31H(1)
2EH(.)
00H
2DH(-)
32H(2)
33H(3)
33H(3)
-123
16-bit binary
data
+0
Number of all
digits
Number of digits
of decimal part
Sign
S
1
+0
+1
+1
b15
+2
+3
+4
b8 b7
b0
0000H is automatically stored at
the end of a character string.
D
S
2
16-bit binary
data
+1
For number of
all digits
For value
For value
stored in
S
1
ASCII code in "(Value
specifying number of all
digits - 1)"th digit
ASCII code in "(Value
specifying number of all
digits - 3)"th digit
ASCII code in "(Value
specifying number of all
digits - 5)"th digit
ASCII code in "(Value
specifying number of all
digits - 7)"th digit
ASCII code
indicating sign
ASCII code in "(Value
specifying number of all
digits - 2)"th digit
ASCII code in "(Value
specifying number of all
digits - 4)"th digit
ASCII code in "(Value
specifying number of all
digits - 6)"th digit
0000H
S
1
S
1
S
2
D
S
2
S
2
1 2
3
Number of digits of
decimal part
Number of
all digits
4
It is automatically
added.
Number of
digits of
decimal part
16-bit
binary data
6
2
1234
S
1
S
1
0
0 1 2
6
3
3
12
Number of
all digits
Number of
digits of
decimal part
16-bit
binary data
It is automatically
added.
S
1
S
2