1946
32 STRING FUNCTIONS
32.2 Extracting String Data From the Left/Right
32.2 Extracting String Data From the Left/Right
LEFT(_E), RIGHT(_E)
• LEFT(_E): These functions extract and output the specified number of characters, starting from the left end of the string
input.
• RIGHT(_E): These functions extract and output the specified number of characters, starting from the right end of the string
input.
■Description, type, data type
Ladder, FBD/LD Structured text
[Without EN/ENO] [With EN/ENO] [Without EN/ENO]
d:=LEFT(s,n);
d:=RIGHT(s,n);
[With EN/ENO]
d:=LEFT_E(EN,ENO,s,n);
d:=RIGHT_E(EN,ENO,s,n);
Argument Description Type Data type
EN Execution condition (TRUE: Executed, FALSE: Not executed) Input variable BOOL
s (IN) Input Input variable ANYSTRING_SINGLE
n (L) Number of characters to be extracted Input variable INT
ENO Output status (TRUE: Normal, FALSE: Abnormal) Output variable BOOL
d Output Output variable ANYSTRING_SINGLE
RnCPU
RnENCPU
RnSFCPU RnSFCPURnPCPURnPCPU
(Standard) (Safety)
(Redundant)
(Process)
EN ENO
sd
n