implementation-dependent parameter
. The actual number of inputs effective in a formal call of an
extensible function is determined by the formal input name with the highest position in the sequence of
parameter names.
EXAMPLE 1
The statement
X := ADD(Y1,Y2,Y3);
is equivalent to
X := ADD(IN1 := Y1, IN2 := Y2, IN3 := Y3);
EXAMPLE 2
The following statements are equivalent:
I := MUX_INT(K:=3,IN0 := 1, IN2 := 2, IN4 := 3);
I := 0;
2.5.1.5.1 Type conversion functions
As shown in table 22, type conversion functions shall have the form *_TO_**, where “*” is the type of
the input variable IN, and “**” the type of the output variable OUT, for example, INT_TO_REAL. The
effects of type conversions on accuracy, and the types of errors that may arise during execution of
type conversion operations, are implementation-dependent parameters.
Table 22 - Type conversion function features
No.
Graphical form
Usage example
1
a,b,e
+---------+
* ---| *_TO_** |--- **
+---------+
(*) - Input data type, e.g., INT
(**) - Output data type, e.g., REAL
(*_TO_**) - Function name, e.g., INT_TO_REAL
A := INT_TO_REAL(B) ;
2
c
+-------+
ANY_REAL---| TRUNC |---ANY_INT
+-------+
A := TRUNC(B) ;
3
d
+-------------+
*--| *_BCD_TO_** |---**
+-------------+
A := WORD_BCD_TO_INT(B);
4
d
+-------------+
**--| **_TO_BCD_* |---*
+-------------+
A := INT_TO_BCD_WORD(B);
NOTE Usage examples are given in the ST language defined in 3.3.
Copyright International Electrotechnical Commission
Provided by IHS under license with IEC
Not for Resale
No reproduction or networking permitted without license from IHS
--``````-`-`,,`,,`,`,,`---
– 56 –
61131-3
IEC:2003(E)
Do'stlaringiz bilan baham: |