Search For Character String From Specified Position - Mitsubishi MELSEC-q Programming Manual

Melsec q series; melsec l series
Hide thumbs Also See for MELSEC-q:
Table of Contents

Advertisement

6 IEC FUNCTIONS

6.10.9 Search for character string from specified position

The specified character string is searched for the specified character string.
Function definition
Function definition
6 - 77
INT FIND( STRING S1, STRING S2 );
Argument
Argument Name
IN/OUT
S1
IN
S2
IN
Return value
Return Value
INT
Position where character string is found first (BIN 16-bit data)
Remarks: This function cannot be used with the Basic model QCPU.
If the character string is not found, the return value turns to 0.
Example of use
Argument Type
STRING
w_Word1:=
FIND(w_Str1,w_Str2);
BOOL FIND_E( BOOL EN, STRING S1, STRING S2, INT D1 );
Argument
Argument Name
IN/OUT
EN
IN
S1
IN
S2
IN
D1
OUT
Remarks: If the character string is not found, the return value turns to 0.
Return value
Return Value
BOOL
Execution condition
Example of use
(*
When execution condition X0 turns ON, the character string data in sData1 is
(*
searched for the character string data in sData2, and the position where the
(*
character string is found first is stored into Result.
M0 := FIND_E( X0, sData1, sData2, Result ) ;
FIND
FIND_E
Character string to be searched (character string data)
Character string to be searched for (character string data)
ST Program
Conversion Result
LD
INSTR
Execution condition (Function is executed only when the result is TRUE)
Character string to be searched (character string data)
Character string to be searched for (character string data)
Position where character string is found first (BIN 16-bit data)
Description
Description
Used Instruction
SM400
LD,INSTR
w_Str2
w_Str1
w_Word1 K1
Description
Description
*)
*)
*)
6 - 77

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-l

Table of Contents