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


Table 29 - Standard character string functions


Download 1.35 Mb.
Pdf ko'rish
bet57/158
Sana17.06.2023
Hajmi1.35 Mb.
#1528208
1   ...   53   54   55   56   57   58   59   60   ...   158
Bog'liq
ourdev 569653

Table 29 - Standard character string functions
No.
Graphical form
 a
Explanation/example
1
+-----+
ANY_STRING--| LEN |--ANY_INT
+-----+
String length function
Example:
A := LEN('ASTRING');
is equivalent to A := 7;
2
+------+
| LEFT |
ANY_STRING--|IN |--ANY_STRING
ANY_INT-----|L |
+------+
Leftmost L characters of IN
Example:
A := LEFT(IN:='ASTR',L:=3);
is equivalent to
A := 'AST' ;
3
+-------+
| RIGHT |
ANY_STRING--|IN |--ANY_STRING
ANY_INT-----|L |
+-------+
Rightmost L characters of IN
Example:
A := RIGHT(IN:='ASTR',L:=3);
is equivalent to
A := 'STR' ;
4
+-------+
| MID |
ANY_STRING--|IN |--ANY_STRING
ANY_INT-----|L |
ANY_INT-----|P |
+-------+
L characters of IN,
beginning at the P-th
Example:
A := MID(IN:='ASTR',L:=2,P:=2);
is equivalent to
A := 'ST' ;
5
+--------+
| CONCAT |
ANY_STRING---| |--ANY_STRING
: ---| |
ANY_STRING---| |
+--------+
Extensible concatenation
Example:
A := CONCAT('AB','CD','E') ;
is equivalent to
A := 'ABCDE' ;
6
+--------+
| INSERT |
ANY_STRING--|IN1 |--ANY_STRING
ANY_STRING--|IN2 |
ANY_INT-----|P |
+--------+
Insert IN2 into IN1 after the
P-th character position
Example:
A:=INSERT(IN1:='ABC',IN2:='XY',P=2
);
is equivalent to
A := 'ABXYC' ;
7
+--------+
| DELETE |
ANY_STRING--|IN |--ANY_STRING
ANY_INT-----|L |
ANY_INT-----|P |
+--------+
Delete L characters of IN, beginning
at the P-th character position
Example:
A := DELETE(IN:='ABXYC',L:=2,
P:=3) ;
is equivalent to
A := 'ABC' ;
Copyright International Electrotechnical Commission 
Provided by IHS under license with IEC
Not for Resale
No reproduction or networking permitted without license from IHS
--``````-`-`,,`,,`,`,,`---


– 64 –
61131-3 
 IEC:2003(E)

Download 1.35 Mb.

Do'stlaringiz bilan baham:
1   ...   53   54   55   56   57   58   59   60   ...   158




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