
Drive PLC Developer Studio
IEC 61131-3 Standard functions
14-8
l
DDS EN 2.3
14.3.3 RIGHT
Returns a right start string of a string
• STR is of type STRING, SIZE of type INT, the return value of the function type STRING.
• RIGHT (STR, SIZE) means: Take the first SIZE characters from the right in the string STR.
Examples
IL ST FBD
LD ’SUSI’
RIGHT 3
ST Var1 (* Var1=’USI’ *)
Var1:=RIGHT(’SUSI’,3);
14.3.4 MID
Returns a segment of a string
• STR is of type STRING, LEN and POS of type INT, the return value of the function type
STRING.
• MID (STR, LEN, POS) means: Get LEN characters from the string STR starting with the
character at POS.
Examples
IL ST FBD
LD ’SUSI’
MID 2,2
ST Var1 (* Var1=’US’ *)
Var1:=MID(’SUSI’,2,2);
14.3.5 CONCAT
Concatenation
Concatenating two strings
• STR1, STR2 and the return value of the function are of type STRING.
Examples
IL ST FBD
LD ’SUSI’
CONCAT ’WILLI’
ST Var1
(* Var1=’SUSIWILLI’ *)
Var1:=CONCAT
(’SUSI’,’WILLI’);
14.3.6 INSERT
Inserts a string into another string from a specific position
• STR1 and STR2 are of type STRING, POS of type INT, the return value of the function type
STRING.
• INSERT(STR1, STR2, POS) means: Insert STR2 into STR1 after the POS-th position.
Examples
IL ST FBD
LD ’SUSI’
INSERT ’XY’,2
ST Var1
(* Var1=’SUXYSI’ *)
Var1 := INSERT
(’SUSI’,’XY’,2);
Kommentare zu diesen Handbüchern