Number Value To Ascii String Conversion - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Example: Real to ASCII
LAD
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.
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
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).
Program instructions
STL
Network 1
LD I2.3
RTA VD2, VB10, 16#A3
7.5 Convert
245

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents