101BExtended instructions
8.2 String and character
S7-1200 Programmable controller
244
System Manual, 11/2011, A5E02486680-05
Table 8- 26 Format of the STRG_VAL instruction
Bit
16
Bit 8 Bit 7
Bit 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
f
r
f = Notation format
1= Exponential notation
0 = Fixed point notation
r = Decimal point format
1 = "," (comma character)
0 = "." (period character)
Table 8- 27 Values of the FORMAT parameter
FORMAT (W#16#)
Notation format
Decimal point representation
0000 (default)
"."
0001
Fixed point
","
0002
"."
0003
Exponential
","
0004 to FFFF
Illegal values
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 instruction
Table 8- 28 Value-to-string operation
LAD / FBD
SCL
Description
"VAL_STRG"(
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.