Chapter 22 String manipulation instructions
606 Rockwell Automation Publication 2080-RM001D-EN-E - February 2015
Using the position and number of characters provided, MID yields required parts
of strings.
Arguments
Parameter Parameter Type Data Type Description
EN Input BOOL Function enable.
When EN = TRUE, generate portion of a string.
When EN = FALSE, no generate operation.
IN Input STRING Any non-empty string.
NbC Input DINT Number of characters to be extracted cannot be greater than the length
of the IN string.
Pos Input 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 Output 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.
ENO Output BOOL Enable out.
MID function language examples
Function block diagram