EasyManua.ls Logo

Siemens Simatic S7 Series

Siemens Simatic S7 Series
726 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...
Program instructions
7.15 String
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
325
Example: Find character within string instruction
A string stored at VB0 contains the temperature. The string constant at IN1 provides all the
numeric characters (0-9, +, and -) that can identify a temperature number in a string.
CHR_FIND execution finds the starting position of the character "9" in the VB0 string and
then S_R execution converts the real number characters into a real number value. VD200 is
used to store the real-number value of the temperature.
LAD
STL
1. Set AC0 to 1. (AC0 is used as the
OUT parameter and points to the
first character position in the
string.)
2. Find the first numeric character in
the string stored at VB0.
3. Convert the string to a real num-
ber value.
Network 1
LD I0.0
MOVB 1, AC0
CFND VB0, VB20, AC0
STR VB0, AC0, VD200

Table of Contents

Other manuals for Siemens Simatic S7 Series

Related product manuals