MID

Using the position and number of characters provided, yields required parts of strings.
lrsf_mi1_cam5
Arguments
IN
IN
STRING
Any non-empty string
NbC
NbC
DINT
Number of characters to extract (must be less than or equal to the length of the IN string)
Pos
Pos
DINT
Position of the sub-string
the sub-string first character is the one pointed to by Pos
(the first valid position is 1)
MID
Q
STRING
Middle part of the string (its length = NbC).
When the number of characters to extract exceeds the length of the IN string, NbC is automatically recalculated to get the remainder of the string only. When NbC or Pos are zero or negative numbers, an empty string is returned.
Example
(* FBD Program using "MID" Function *)
lrsf_mi2_cam5
(* ST Equivalence: *)
sub_string := MID ('abcdefgh', 2, 4); (* sub_string is 'de' *)
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal