Basic Concepts for Programming an S7-200 CPU
4-16
S7-200 Programmable Controller System Manual
A5E00066097-02
Using Direct Addressing in IEC for Overloaded Instructions
IEC 1131-3 programming modes permit you to use directly represented memory
locations as a part of instruction parameter configuration. Both variables and
memory locations can be used within parameters. Remember that directly
represented memory locations do not contain explicit type information. Also, type
information cannot be determined from any of the overloaded IEC instructions,
because these instructions accept varying data types.
Data types for directly represented parameters are determined by examining other
typed parameters included within the instruction. When an instruction parameter
type is configured to use a variable that is of a specific type, all directly
represented parameters will be assumed to be of that type. Table 4-8 and
Table 4-9 show examples of data types for directly represented parameters. The
percentage sign (%) is used to indicate a direct address.
Table 4-8 Example of Data Types for Direct Addressing
Name
Address Data Type Comment
Var1 REAL This is a floating-point variable.
Var2 DINT This is a double integer variable.
Var3 INT This is an integer variable.
Table 4-9 Examples of Direct Addressing in Overloaded Instructions
Example Description
ADD
IN2
EN
%VD100
IN1Var1
ENO
OUT %VD200
VD100 and VD200 will be assumed to be of type REAL since
Var1 is of type REAL.
IN2
EN
IN1
ENO
OUT
%VD400
ADD
%VD300
Var2
VD300 and VD400 will be assumed to be of type DINT since
Var2 is of type DINT.
ADD
IN2
EN
%VW500
IN1Var3
ENO
OUT %VW600
VW500 and VW600 will be assumed to be of type INT since
Var3 is of type INT.
ADD
IN2
EN
%AC0
IN1
ENO
OUT
%AC1
Var1
AC0 and AC1 will be assumed to be of type REAL since Var1
is of type REAL.
IN2
EN
IN1
ENO
OUT
ADD
%AC0
%AC0
%AC1
This configuration is illegal since the type cannot be
determined. The type of data within the accumulators could
be any type.
IN2
EN
IN1
ENO
OUT
ADD
%*AC0
%*AC0 %*AC1
This configuration is illegal since the type cannot be
determined. The type of data within the accumulator pointers
could be any type.
% indicates an indirect address.