Iec 61131-3 Second edition 2003-01 Programmable controllers – Part 3: Programming languages


Figure 7 - Examples of explicit type conversion with overloaded functions


Download 1.35 Mb.
Pdf ko'rish
bet49/158
Sana17.06.2023
Hajmi1.35 Mb.
#1528208
1   ...   45   46   47   48   49   50   51   52   ...   158
Bog'liq
ourdev 569653

Figure 7 - Examples of explicit type conversion with overloaded functions
Type declaration
(ST language - see 3.3)
Usage
(FBD language - see 4.3)
(ST language - see 3.3)
VAR
A : INT ;
B : INT ;
C : INT ;
END_VAR
+---------+
A---| ADD_INT |---C
B---| |
+---------+
C := ADD_INT(A,B);
NOTE Type conversion is not required in the example shown above.
VAR
A : INT ;
B : REAL ;
C : REAL;
END_VAR
+-----------+ +----------+
A---|INT_TO_REAL|---| ADD_REAL |---C
+-----------+ | |
B-------------------| |
+----------+
C := ADD_REAL(INT_TO_REAL(A),B);
VAR
A : INT ;
B : INT ;
C : REAL;
END_VAR
+---------+ +-----------+
A---| ADD_INT |---|INT_TO_REAL|---C
| | +-----------+
B---| |
+---------+
C := INT_TO_REAL(ADD_INT(A,B));
Figure 8 - Examples of explicit type conversion with typed functions
IEC 2477/02
IEC 2478/02
Copyright International Electrotechnical Commission 
Provided by IHS under license with IEC
Not for Resale
No reproduction or networking permitted without license from IHS
--``````-`-`,,`,,`,`,,`---


61131-3 
 IEC:2003(E)
– 55 –
2.5.1.5 Standard functions
Definitions of functions common to all programmable controller programming languages are given in
this subclause. Where graphical representations of standard functions are shown in this subclause,
equivalent textual declarations may be written as specified in 2.5.1.3.
A standard function specified in this subclause to be extensible is allowed to have two or more inputs
to which the indicated operation is to be applied, for example, extensible addition shall give as its
output the sum of all its inputs. The maximum number of inputs of an extensible function is an

Download 1.35 Mb.

Do'stlaringiz bilan baham:
1   ...   45   46   47   48   49   50   51   52   ...   158




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling