101BExtended instructions
8.2 String and character
S7-1200 Programmable controller
248
System Manual, 11/2011, A5E02486680-05
Table 8- 34 Examples of S_CONV value to string conversion
Data type
IN value
OUT string
ENO
UInt
123
"123"
TRUE
UInt
0
"0"
TRUE
UDInt
12345678
"12345678"
TRUE
Real
-INF
"INF"
FALSE
Real
+INF
"INF"
FALSE
Real
NaN
"NaN"
FALSE
Table 8- 35 Examples of STRG_VAL conversion
IN string
FORMAT
(W#16#....)
OUT data type
OUT value
ENO
"123"
0000
Int or DInt
123
TRUE
"-00456"
0000
Int or DInt
-456
TRUE
"123.45"
0000
Int or DInt
123
TRUE
"+2345"
0000
Int or DInt
2345
TRUE
"00123AB"
0000
Int or DInt
123
TRUE
"123"
0000
Real
123.0
TRUE
"-00456"
0001
Real
-456.0
TRUE
"+00456"
0001
Real
456.0
TRUE
"123.45"
0000
Real
123.45
TRUE
"123.45"
0001
Real
12345.0
TRUE
"123,45"
0000
Real
12345.0
TRUE
"123,45"
0001
Real
123.45
TRUE
".00123AB"
0001
Real
123.0
TRUE
"1.23e-4"
0000
Real
1.23
TRUE
"1.23E-4"
0000
Real
1.23
TRUE
"1.23E-4"
0002
Real
1.23E-4
TRUE
"12,345.67"
0000
Real
12345.67
TRUE
"12,345.67"
0001
Real
12.345
TRUE
"3.4e39"
0002
Real
+INF
TRUE
"-3.4e39"
0002
Real
-INF
TRUE
"1.1754943e-38"
(and smaller)
0002
Real
0.0
TRUE
"12345"
N/A
SInt
0
FALSE
"A123"
N/A
N/A
0
FALSE
""
N/A
N/A
0
FALSE
"++123"
N/A
N/A
0
FALSE
"+-123"
N/A
N/A
0
FALSE