Siemens Simatic S7 Series System Manual page 213

Hide thumbs Also See for Simatic S7 Series:
Table of Contents

Advertisement

Input / output
Data type
IN
STRING
INDX
BYTE
OUT
INT
DINT, REAL
String input format for S_I (integer number) and S_DI (double integer number)
[spaces] [+ or -] [digits 0 - 9]
String input format for S_R (real number)
[spaces] [+ or -] [digits 0 - 9] [. or ,] [digits 0 - 9]
INDX parameter
The INDX value is normally set to 1, which starts the conversion with the first character of
the string. The INDX value can be set to other values to start the conversion at different
points within the string. This can be used when the input string contains text that is not part
of the number to be converted. For example, if the input string is "Temperature: 77.8", you
set INDX to a value of 13 to skip over the word "Temperature: " at the start of the string.
The Substring to Real instruction does not convert strings using scientific notation or
exponential forms of real numbers. The instruction does not produce an overflow error
(SM1.1) but converts the string to a real number up to the exponential and then terminates
the conversion. For example, the string '1.234E6' converts without errors to a real value of
1.234.
The conversion is terminated when the end of the string is reached or when the first invalid
character is found. An invalid character is any character that is not a digit (0 - 9), or one of
the following characters: plus (+), minus (-), comma (,), or period (.).
The overflow error (SM1.1) is set whenever the conversion produces an integer value that is
too large for the output value. For example, the Substring to Integer instruction sets the
overflow error if the input string produces a value greater than 32767 or less than -32768.
The overflow error (SM1.1) is also set if no conversion is possible when the input string does
not contain a valid value. For example, if the input string contains 'A123', the conversion
instruction sets SM1.1 (overflow) and the output value remains unchanged.
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
Operand
VB, LB, *VD, *LD, *AC, Constant string
VB, IB, QB, MB, SMB, SB, LB, AC, *VD, *LD, *AC, Constant
VW, IW, QW, MW, SMW, SW, T, C, LW, AC, AQW, *VD, *LD, *AC
VD, ID, QD, MD, SMD, SD, LD, AC, *VD, *LD, *AC
Program instructions
7.5 Convert
213

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart series

Table of Contents