Siemens S7-1200 System Manual page 295

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

An integer, unsigned integer, or floating point value IN is converted to the corresponding
character string at OUT. The parameter OUT must reference a valid string before the
conversion is executed. A valid string consists of a maximum string length in the first byte,
the current string length in the second byte, and the current string characters in the next
bytes. The converted string replaces characters in the OUT string starting at the first
character and adjusts the current length byte of the OUT string. The maximum length byte of
the OUT string is not changed.
How many characters are replaced depends on the parameter IN data type and number
value. The number of characters replaced must fit within the parameter OUT string length.
The maximum string length (first byte) of the OUT string should be greater than or equal to
the maximum expected number of converted characters. The following table shows S_CONV
value to string conversion examples.
Output String format rules:
● Values written to parameter OUT do not use a leading "+" sign.
● Fixed-point representation is used (no exponential notation).
● The period character "." is used to represent the decimal point when parameter IN is the
● Values are right-justified in the output string and are preceded by space characters that
Table 8- 21
Maximum string lengths for each data type
IN data type
Character
positions
allocated by
S_CONV
USInt
4
SInt
4
UInt
6
Int
6
UDInt
11
DInt
11
Real
14
LReal
21
The "
" characters represent space characters that fill empty positions in the right-justified field that is allocated for the
1
x
converted value.
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
Real data type.
fill empty character positions.
Converted string example
"x4294967295" 13
"x-3.402823E+38"
"x-1.175495E-38"
"x+1.175495E-38"
"x+3.402823E+38"
"-1.7976931348623E+308"
"-2.2250738585072E-308"
"+2.2250738585072E-308"
"+1.7976931348623E+308"
Total string length including maximum and current length
1
"x255" 6
"-128" 6
"x65535" 8
"-32768" 8
"-2147483648" 13
16
23
Extended instructions
8.2 String and character
bytes
295

Advertisement

Table of Contents
loading

Table of Contents