652
FX
3G
/FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
26 Character String Control – FNC200 to FNC209
26.2 FNC201 – VAL / Character String to BIN Conversion
• When the binary data acquired by conversion is outside the following range (error code: K6706)
• When "00H" is not present in the location from
to the final device number (error code: K6706)
Program example
1) In the program below, the character string data stored in D20 to D22 is regarded as an integer value,
converted into a binary value, and stored in D0 when X000 is set to ON.
2) In the program below, the character string data stored in D20 to D24 is regarded as an integer value,
converted into a binary value, and stored in D0 when X000 is set to ON.
Setting range
16-bit operation
−
32768 to 32767
32-bit operation
−
2,147,483,648 to 2,147,483,647
S
X000
FNC201
VALP
D10
D0
END
D20
-1654
6
2
b15
b8 b7
b0
D20
D21
D22
31H(1)
2EH(.)
2DH(-)
36H(6)
34H(4)
35H(5)
D23
D0
D10
D11
Number of all digits
Number of digits of decimal part
"00H" is stored here.
00H
X000
FNC201
DVALP
D10
D0
END
D20
10
3
b15
b8 b7
b0
D20
D21
D22
37H(7)
31H(1)
20H(space)
39H(9)
30H(0)
30H(0)
D23
D0
D10
D11
Number of all digits
Number of digits of decimal part
36H(6)
2EH(.)
31H(1)
31H(1)
D24
D25
7910 0611
D1
D0
"00H" is stored here.
00H