Copy Substring From String - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Program instructions
7.15 String
7.15.2

Copy substring from string

LAD / FBD
STL
SSCPY IN,
INDX, N, OUT
Non-fatal errors with ENO=0
0006H Indirect address
0091H Operand out of range
009BH Index = 0
Input / output
Data type
IN
STRING
OUT
STRING
INDX, N
BYTE
Example: Copy substring instruction
AD
364
Description
The copy substring from string instruction copies the assigned number of charac-
ters N from the string specified by IN, starting at the index INDX, to a new
string assigned by OUT.
Note: The SSTR_CPY instruction operates on bytes and not characters. Because
Chinese characters are not represented by a single byte, unexpected results can
occur with the SSTR_CPY instruction with strings containing Chinese characters.
If you know the number of bytes that a character string occupies, you can use the
SSTR_CPY instruction with the correct number of bytes.
SM bits affected
None
Operand
VB, LB, *VD, *LD, *AC, Constant string
VB, LB, *VD, *LD, *AC
IB, QB, VB, MB, SMB, SB, LB, AC, *VD, *LD, *AC, Constant
Starting at the seventh byte after the
byte count in the string at VB0, copy 5
bytes to a new string at VB20.
STL
Network 1
LD I0.0
SSCPY VB0, 7, 5, VB20
System Manual, V2.3, 07/2017, A5E03822230-AF
S7-200 SMART

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents