Instructions that inspect and manipulate STRING variables using 1-based character positions in accordance with IEC 61131-3.
| Instruction | Operands | Description |
|---|---|---|
| CONCAT | IN1, IN2 -> target (STRING) |
Concatenate two strings (IN1 + IN2) |
| LEN | IN -> target (INT) |
Return the character length of IN |
| LEFT | IN, L -> target (STRING) |
Extract the leftmost L characters of IN |
| RIGHT | IN, L -> target (STRING) |
Extract the rightmost L characters of IN |
| MID | IN, L, P -> target (STRING) |
Extract L characters from IN starting at 1-based position P |
| FIND | IN1, IN2 -> target (INT) |
Return the 1-based start position of IN2 inside IN1 (0 if not found) |
| REPLACE | IN1, IN2, L, P -> target (STRING) |
Replace L characters in IN1 at position P with IN2 |
| INSERT | IN1, IN2, P -> target (STRING) |
Insert IN2 into IN1 after position P |
| DELETE | IN, L, P -> target (STRING) |
Delete L characters from IN starting at position P |
Combine string instructions with the
P(Pulse) qualifier to execute once when the step activates, or attach them directly to a transition to run when the transition fires.