Program instructions
7.5 Convert
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
245
Example: Real to ASCII
LAD
STL
Convert the real value at VD2 to 10
ASCII characters starting at VB10,
using a format of 16#A3 (a period for
the decimal point, followed by 3 dig-
its).
Network 1
LD I2.3
RTA VD2, VB10, 16#A3
See also
Assigning a constant value for instructions (Page 83)
7.5.3
Number value to ASCII string conversion
Format of the STRING data type
A string variable is a sequence of characters, with each character stored as a byte. The first
byte of the STRING data type defines the length of the string, which is the number of
character bytes.
The diagram below shows the STRING data type stored as a variable in memory. The string
can have a length of 0 to 254 characters. The maximum storage requirement for a variable
string is 255 bytes (the length byte plus 254 characters).
If a constant string parameter is entered directly in the program editor (126 characters
maximum) or a variable string is initialized in the data block editor (254 characters
maximum), the string assignment must begin and end with double quote characters.