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

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. |
RIGHT | Output | STRING | Right part of the string (length = NbC). Can be:
|
ENO | Output | BOOL | Enable output. Applies to ladder diagram programs. |
RIGHT examples
RIGHT function block diagram example

RIGHT ladder diagram example

RIGHT 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