Siemens SIMATIC S7 System Manual page 391

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Example variable table
Example: Subroutine call with call parameters
LAD
Note
There are two STL examples provided above. STL programmers can use the first simplified
STL instructions, which can only be displayed in the STL editor. This is because the BOOL
parameters used as LAD/FBD power flow inputs are not saved to L memory.
The second set of compiler generated STL instructions can be displayed in the LAD, FBD,
and STL editors, because L memory is used by the program compiler to save the state of the
BOOL input parameters that are assigned as power flow inputs in LAD/FBD.
Address parameters such as IN4 (&VB100) are passed into a subroutine as a DWORD
(unsigned double word) value. The type of a constant parameter must be specified for the
parameter in the calling routine with a constant descriptor in front of the constant value. For
example, to pass an unsigned double word constant with a value of 12,345 as a parameter,
the constant parameter must be specified as DW#12345. If the constant describer is omitted
from the parameter, the constant can be assumed to be a different type.
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
STL
STL only:
Network 1
LD I0.0
CALL SBR_0, I0.1, VB10, I1.0, &VB100, *AC1, VD200
To display correctly in LAD and FBD:
Network 1
LD I0.0
= L60.0
LD I0.1
= L63.7
LD L60.0
CALL SBR_0, L63.7, VB10, I1.0, &VB100, *AC1, VD200
Program instructions
7.18 Subroutine
391

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents