Extended instructions
8.2 String and character
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
297
Table 8- 25 Values of the FORMAT parameter
Decimal point representation
Fixed point
Exponential
Rules for STRG_VAL conversion:
● If the period character "." is used for the decimal point, then commas "," to the left of the
decimal point are interpreted as thousands separator characters. The comma characters
are allowed and ignored.
● If the comma character "," is used for the decimal point, then periods "." to the left of the
decimal point are interpreted as thousands separator characters. These period
characters are allowed and ignored.
● Leading spaces are ignored.
VAL_STRG (convert numerical value to string)
Table 8- 26 Value-to-string operation
in:=_variant_in,
size:=_usint_in,
prec:=_usint_in,
format:=_word_in,
p:=uint_in,
out=>_string_out);
Converts an integer, unsigned integer, or floating point
value to the corresponding character string
representation.
1
For LAD / FBD: Click the "???" and select the data type from the drop-down list.
Table 8- 27 Data types for the VAL_STRG instruction
IN IN
SInt, Int, DInt, USInt, UInt,
UDInt, Real, LReal
Value to convert
Number of characters to be written to the OUT string
PREC IN USInt The precision or size of the fractional portion. This does
not include the decimal point.
P IN UInt, Byte, USInt IN: Index to the first OUT string character to be replaced