EasyManua.ls Logo

Siemens S7-1200 - Page 297

Siemens S7-1200
1028 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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
FORMAT (W#16#)
Notation format
Decimal point representation
0000 (default)
Fixed point
"."
0001
","
0002
Exponential
"."
0003
","
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 (convert numerical value to string)
Table 8- 26 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.
Table 8- 27 Data types for the VAL_STRG instruction
Parameter and type
Data type
Description
IN IN
SInt, Int, DInt, USInt, UInt,
UDInt, Real, LReal
Value to convert
SIZE
IN
USInt
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.
FORMAT
IN
Word
Output format options
P IN UInt, Byte, USInt IN: Index to the first OUT string character to be replaced
(first character = 1)
OUT
OUT
String
The converted string

Table of Contents

Other manuals for Siemens S7-1200

Related product manuals