Panasonic FP Series Programming Manual page 269

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

String instructions
MID
MID copies L characters of the string IN starting at position P with 1 denoting the first character of
Description
the string. The result is written into the output variable.
To add an enable input and enable output to the instruction, select [With EN/ENO] from the
"Instructions" pane (LD, FBD or IL editor). To reuse an instruction select "Recently used" from the
context menu or press <Ctrl>+<Shift>+<v> in the programming window.
PLC types
Availability of MID (see page 1328)
 The sum of start position and number of characters to be delivered
should not be greater than the input string. If you want to receive for
example 5 characters of a 10-character string, starting from position 7,
only the last 4 characters are delivered.
 If the output string is longer than the length defined for the output
variable (output_string) in the field "Type", only as many characters
are copied from the start position as the output variable can hold. The
special internal relay R9009 (%MX0.900.9) is set.
 The number of steps may vary depending on the PLC and parameters
used, see also Table of Code Intensive Instructions in the online help.
(up to 200 steps)
Data types
Data type
STRING
INT
INT
STRING
Error Flags
No.
IEC address
%MX0.900.7
R9007
%MX0.900.8
R9008
%MX0.900.9
R9009
In this example, the same POU header is used for all programming languages. For an example
Example
using IL (instruction list), please refer to the online help.
268
Copy characters from a middle position
I/O
Function
1st input
input string
2nd input
number of input string's characters that are copied
3rd input
position where copying begins
output
copied string
Set
permanently
for an instant
for an instant
If
 input string is longer than the length
defined for the input variable in the field
"Type" or start position is greater than
the input string
 output string is longer than the length
defined for the output variable in the field
"Type"

Advertisement

Table of Contents
loading

Table of Contents