Subroutine Call In Lad And Stl - Siemens SIMATIC S7-200 System Manual

Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

The data type field in the local variable table defines the size and format of the
parameter. The parameter types are:
Power Flow: Boolean power flow is allowed only for bit (Boolean) inputs. This
declaration tells STEP 7-Micro/WIN 32 that this input parameter is the result of
power flow based on a combination of bit logic instructions. Boolean power flow
inputs must appear first in the local variable table before any other type input.
Only input parameters are allowed to be used this way. The enable input (EN)
and the IN1 inputs in Figure 9-54 use Boolean logic.
Boolean - This data type is used for single bit inputs and outputs. IN2 in
Figure 9-54 is a Boolean input.
Byte, Word, Dword - These data types identify an unsigned input or output
parameter of 1, 2, or 4 bytes respectively.
INT, DINT - These data types identify signed input or output parameters of 2 or
4 bytes respectively.
Real - This data type identifies a single precision (4 byte) IEEE floating point
value.
I0.0
I0.1
Figure 9-54
Address parameters such as IN4 in Figure 9-54 (&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
describer 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 parameter,
the constant may be assumed to be a different type.
There are no automatic data type conversions performed on the input or output
parameters. For example, if the local variable table specifies that a parameter has
the data type Real, and in the calling routine a double word (Dword) is specified for
that parameter, the value in the subroutine will be a double word.
When values are passed to a subroutine, they are placed into the local memory of
the subroutine. The left-most column of the local variable table (see Figure 9-53)
shows the local memory address for each passed parameter. Input parameter
values are copied to the subroutine's local memory when the subroutine is called.
Output parameter values are copied from the subroutine's local memory to the
specified output parameter addresses when the subroutine execution is complete.
S7-200 Programmable Controller System Manual
A5E00066097-02
LAD
SBR10
EN
IN1
OUT1
VB10
IN2
I1.0
IN3
&VB100
IN4
*AC1
IN/OUT

Subroutine Call in LAD and STL

SIMATIC Instructions
LD
I0.0
CALL
10, I0.1, VB10,
I1.0, &VB100,
*AC1, VD200
VD200
STL
9-151

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents