Extended instructions
9.2 String and character
S7-1200 Programmable controller
352 System Manual, V4.2, 09/2016, A5E02486680-AK
The FORMAT parameter for the VAL_STRG instruction is defined below. The unused bit
positions must be set to zero.
Table 9- 28 Format of the VAL_STRG instruction
s = Number sign character
1= use sign character "+" and "
-"
0 = use sign character "-" only
1 = "," (comma character)
0 = "." (period character)
Table 9- 29 Values of the FORMAT parameter
Decimal point representation
"-" only Fixed point
Exponential
"+" and "-" Fixed Point
W#16#0006 Exponential "."
W#16#0008 to W#16#FFFF Illegal values
Parameter OUT string format rules:
● Leading space characters are added to the leftmost part of the string when the converted
string is smaller than the specified size.
● When the FORMAT parameter sign bit is FALSE, unsigned and signed integer data type
values are written to the output buffer without the leading "+" sign. The "-" sign is used if
required.
<leading spaces><digits without leading zeroes>'.'<PREC digits>
● When the sign bit is TRUE, unsigned and signed integer data type values are written to
the output buffer always with a leading sign character.
<leading spaces><sign><digits without leading zeroes>'.'<PREC digits>
● When the FORMAT is set to exponential notation, Real data type values are written to the
output buffer as:
<leading spaces><sign><digit> '.' <PREC digits>'E' <sign><digits without leading zero>