Siemens SIMATIC S7 System Manual page 367

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

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
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
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.
Program instructions
STL
Network 1
LD I0.0
MOVB 1, AC0
CFND VB0, VB20, AC0
STR VB0, AC0, VD200
7.15 String
367

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents