61131-3
IEC:2003(E)
– 53 –
2.5.1.4 Typing, overloading, and type conversion
A
standard function,
function block type, operator,
or instruction is said to be overloaded when it can
operate on input data elements of various types within a generic type designator as defined in 2.3.2.
For instance, an overloaded addition function on generic type ANY_NUM can operate on data of types
LREAL, REAL, DINT, INT, and SINT.
When a programmable controller system supports an overloaded
standard function, function block
type, operator, or instruction, this standard function, function block type, operator, or instruction shall
apply to all data types of the given generic type which are supported by that system. For example, if a
programmable controller system supports the overloaded function ADD and
the data types SINT, INT,
and REAL, then the system shall support the ADD function on inputs of type SINT, INT, and REAL.
When a function which normally represents an overloaded operator is to be typed, i.e., the types of its
inputs and outputs restricted to a particular elementary or derived data type as defined in 2.3, this shall
be done by appending an “underline” character followed by the required type, as shown in table 21.
Table 21 - Typed and overloaded functions
No.
Feature
Example
1
Overloaded functions
+-----+
| ADD |
ANY_NUM-----| |----ANY_NUM
ANY_NUM-----| |
. -----| |
. -----| |
ANY_NUM-----| |
+-----+
Do'stlaringiz bilan baham: