MID
Extracts a part of a message string. The number of characters to be extracted and the position of the first character are given.

Arguments | |||
---|---|---|---|
IN | IN | MESSAGE | Any non-empty string |
NbC | NbC | DINT | Number of characters to be extracted cannot be greater than the length of the IN string |
Pos | Pos | DINT | Position of the sub-string the sub-string first character will be the one pointed to by Pos (first valid position is 1) |
MID | Q | MESSAGE | Middle part of the string (its length = NbC) empty string if parameters are not valid |
Example
(* FBD Program using "MID" Function *)

(* ST Equivalence: *)
sub_string := MID ('abcdefg', 2, 4); (* sub_string is 'de' *)
Provide Feedback