Extended instructions
9.2 String and character
S7-1200 Programmable controller
356 System Manual, V4.2, 09/2016, A5E02486680-AK
The following examples of VAL_STRG conversions are based on an OUT string initialized as
follows:
"
Current Temp = xxxxxxxxxx C"
where the "
x" character represents space characters allocated for the converted value.
Table 9- 34 Example: VAL_STRG conversion
UInt 123 16 10 0000 0
Current Temp =
xxxxxxx123 C
TRUE
UInt 0 16 10 0000 2
Current Temp =
xxxxxx0.00 C
TRUE
UDInt 12345678 16 10 0000 3
Current Temp =
x12345.678 C
TRUE
UDInt 12345678 16 10 0001 3
Current Temp =
x12345,678 C
TRUE
Int 123 16 10 0004 0
Current Temp =
xxxxxx+123 C
TRUE
Int -123 16 10 0004 0
Current Temp =
xxxxxx-123 C
TRUE
Real -0.00123 16 10 0004 4
Current Temp = xxx-
0.0012 C
TRUE
Real -0.00123 16 10 0006 4
Current Temp = -
1.2300E-3 C
TRUE
Real -INF 16 10 N/A 4
Current Temp =
xxxxxx-INF C
FALSE
Real +INF 16 10 N/A 4
Current Temp =
xxxxxx+INF C
FALSE
Real NaN 16 10 N/A 4
Current Temp =
xxxxxxxNaN C
FALSE
UDInt 12345678 16 6 N/A 3
Current Temp =
xxxxxxxxxx C
FALSE