Program instructions
7.18 Subroutine
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
393
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
STL
MAIN
Network 1
LD I0.0
SCPY "string1", VB100
AENO
MOVD &VB100, VD0
MAIN
Network2
LD I0.1
SCPY "string2", VB200
AENO
MOVD &VB200, VD0
MAIN
Network3
LD I0.2
CALL SBR_0, *VD0
MAIN
Network4
LD I0.3
CALL SBR_0, "string3"
SBR0
Network 1
LD SM0.0
SSCPY *LD0, VB300
Содержание SIMATIC S7-200
Страница 30: ...Product overview 1 7 Programming software S7 200 SMART 30 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 267: ...Program instructions 7 6 Counters S7 200 SMART System Manual V2 3 07 2017 A5E03822230 AF 267 HSC modes 3 and 4 ...
Страница 394: ...Program instructions 7 18 Subroutine S7 200 SMART 394 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 425: ...Communication 8 5 PROFIBUS S7 200 SMART System Manual V2 3 07 2017 A5E03822230 AF 425 ...
Страница 786: ...Technical specifications A 11 S7 200 SMART cables S7 200 SMART 786 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 798: ...Error codes C 4 PLC fatal error codes S7 200 SMART 798 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 848: ...Ordering information F 6 Human Machine Interface devices S7 200 SMART 848 System Manual V2 3 07 2017 A5E03822230 AF ...