Fnc208 - Instr / Character String Search - Mitsubishi Electric MELSEC FX3U Programming Manual

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
26.9
FNC208 – INSTR / Character string search
Outline
This instruction searches a specified character string within another character string.
1. Instruction format
FNC 208
INSTR
2. Set data
Operand Type
S
1
S
2
D
n
3. Applicable devices
Bit Devices
Oper-
and
System User
Type
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G
S
1
S
2
D
n
Explanation of function and operation
1. 16-bit operation (INSTR and INSTRP)
1) The character string stored in
higher. The search begins at the "n"th character from the left end (head character) of
search result is stored in
left end (head character)) in
Command
input
Character string to be searched
b15
+0
S
2
+1
+2
+3
+4
+5
2) When the searched character string is not detected, "0" is stored in
3) When the search start position "n" is a negative number or "0", search processing is not executed.
670
Mnemonic
16-bit Instruction
P
INSTR
9 steps
INSTRP
Head device number storing a character string
Head device number storing a character string to be searched
Head device number storing search result
Search start position
Digit Specification
S
1
. The search result provides the first matching character (located from the
D
.
S
2
FNC208
S
S
1
2
INSTR
b8 b7
b0
42H(B)
41H(A)
Search is started from
the 3rd character (n = 3).
44H(D)
43H(C)
Fifth character from
46H(F)
45H(E)
the head character
48H(H)
47H(G)
4AH(J)
49H(I)
00H
4BH(K)
"ABCDEFGHIJK"
26 Character String Control – FNC200 to FNC209
26.9 FNC208 – INSTR / Character string search
Operation Condition
32-bit Instruction
Continuous
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Unit
and higher is searched for within the character string
D
n
S
2
+0
S
1
+1
+2
Mnemonic
Operation Condition
Con-
Real
Index
stant
Number
V Z Modify K H
E
Character string
S
1
b15
b8 b7
b0
46H(F)
45H(E)
48H(H)
47H(G)
00H
"EFGH"
The position where the
first detected character
is located from the
head character in the
5
D
character string data
stored in
.
D
Data Type
Character string
Character string
16-bit binary
16-bit binary
Others
Charac-
Pointer
ter String
" "
P
and
S
2
and the
S
2
S
.
2

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents