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

Table of Contents