DELETE (delete sub-string)

The DELETE instruction deletes characters from a string.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
DELETE
DELETE
DELETE parameters
Parameter
Parameter Type
Data Type
Description
EN
Input
BOOL
Instruction enable.
  • TRUE: Delete specified part of a string.
  • FALSE: No operation.
Applies to ladder diagram programs.
IN
Input
STRING
Any non-empty string.
NbC
Input
DINT
Number of characters to be deleted.
Pos
Input
DINT
Position of the first deleted character (first character of the string has position 1).
DELETE
Output
STRING
Output is:
  • A modified string.
  • An empty string (if Pos < 1).
  • The initial string (if Pos > IN string length).
  • The initial string (if NbC <= 0).
ENO
Output
BOOL
Enable output.
Applies to ladder diagram programs.

DELETE examples

DELETE function block diagram example
DELETE function block diagram example
DELETE ladder diagram example
DELETE ladder diagram example
DELETE structured text example
DELETE structured text example
(* ST Equivalence: *) complete_string := INSERT (’ABCD ’, ’EFGH’, 5); (* complete_string is 'ABCDEFGH ' *) sub_string := DELETE (complete_string, 4, 3); (* sub_string is 'ABGH '*)
Results
Results
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal