Siemens Simatic S7-200 System Manual page 216

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

Advertisement

S7-200 Programmable Controller System Manual
Table 6-75
Parameter
IN
IN_OUT
OUT
TEMP
As shown in Figure 6-37, the data type field in the local variable table defines the size and format of the
parameter. The parameter types are listed below:
6
-
BOOL: This data type is used for single bit
inputs and outputs. IN3 in the following
example 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,
input or output parameters of 2 or 4 bytes,
respectively.
-
REAL: This data type identifies a single precision (4 byte) IEEE floating-point value.
-
Power Flow: Boolean power flow is allowed only for bit (Boolean) inputs. This declaration tells
STEP 7-Micro/WIN 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 the following example use Boolean logic.
Example: Subroutine Call
There are two STL examples provided. The first set of STL instructions can be displayed only in the STL editor since
the BOOL parameters used as power flow inputs are not saved to L memory.
The second set of STL instructions can be displayed also in the LAD and FBD editors because L memory is used to
save the state of the BOOL inputs parameters that are shown as power flow inputs in LAD and FBD.
204
Parameter Types for a Subroutine
Description
Parameters are passed into the subroutine. If the parameter is a direct address (such as VB10), the
value at the specified location is passed into the subroutine. If the parameter is an indirect address
(such as *AC1), the value at the location pointed to is passed into the subroutine. If the parameter is a
data constant (16#1234) or an address (&VB100), the constant or address value is passed into the
subroutine.
The value at the specified parameter location is passed into the subroutine, and the result value from
the subroutine is returned to the same location. Constants (such as 16#1234) and addresses (such as
&VB100) are not allowed for input/output parameters.
The result value from the subroutine is returned to the specified parameter location. Constants (such
as 16#1234) and addresses (such as &VB100) are not allowed as output parameters.
Any local memory that is not used for passed parameters can be used for temporary storage within the
subroutine.
Figure 6-37 Local Variable Table
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

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents