VA Motion Controller Programming Manual
228
10.4.11 MID (Remove several characters in a string)
LD, FBD
programming language
Function: The MID instruction is used to retrieve the last few consecutive characters in the
input string.
Note
: IL, ST
language programming needs to insert variables
IN, L, P
and
OUT
or use
constants in the variable worksheet of the current
POU
数据 Data type processed by MID instruction
The number of characters to be fetched
The starting position of the character to be fetched,
that is, the character is taken from the Pth character of
the input string.
Output, take out the P from the Pth to P+L consecutive
characters in the input string ;
Note : L must be greater than 0; the first P+L characters
must be in the input string ; P must be greater than 0 and
less than or equal to the maximum number of characters in
the input string ; IN must be a non-empty string
Funtion and Action examples
Extract any character in a string
When the contact C 199 is ON , the instruction
is executed to extract three characters in the string in
the address V 412 , where L is the number of symbols
to be extracted, and P is the starting position of the
extracted character.
Execution result: V ECTOR---CTO