Siemens Simatic S7 Series System Manual page 351

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

Advertisement

Example: Subroutine call using string parameter
This example copies a different string literal to a unique address depending upon the given
input. The unique address of this string is saved. The string address is then passed to the
subroutine by using an indirect address. The data type of the subroutine input parameter is
string. The subroutine then moves the string to a different location.
A string literal can also be passed to the subroutine. The string reference inside the
subroutine is always the same.
LAD
MAIN
MAIN
MAIN
MAIN
SBR0
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
Program instructions
7.18 Subroutine
STL
Network 1
LD I0.0
SCPY "string1", VB100
AENO
MOVD &VB100, VD0
Network2
LD I0.1
SCPY "string2", VB200
AENO
MOVD &VB200, VD0
Network3
LD I0.2
CALL SBR_0, *VD0
Network4
LD I0.3
CALL SBR_0, "string3"
Network 1
LD SM0.0
SSCPY *LD0, VB300
351

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart series

Table of Contents