LEFT (extract left of a sting)
The LEFT instruction extracts characters from the left side of a string.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
LEFT

Parameter | Parameter Type | Data Type | Description |
---|---|---|---|
EN | Input | BOOL | Instruction enable.
Applies to ladder diagram programs. |
IN | Input | STRING | Any non-empty string. |
NbC | Input | DINT | Number of characters to be extracted. This number cannot be greater than the length of the IN string. |
LEFT | Output | STRING | Left part of the IN string (its length = NbC). Can be:
|
ENO | Output | BOOL | Enable output. Applies to ladder diagram programs. |
LEFT examples
LEFT function block diagram example

LEFT ladder diagram example

LEFT structured text example

(* ST Equivalence: *) complete_string := RIGHT ('12345678', 4), LEFT ('12345678', 4), 5; (* complete_string is '56781234' the value issued from RIGHT call is '5678' the value issued from LEFT call is '1234'*)
Results

Provide Feedback