Searching String Data - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

32.8

Searching String Data

FIND(_E)
RnPCPU
RnCPU RnENCPU
(Process)
These functions search a character string, and output the operation result.
Ladder, FBD/LD
[Without EN/ENO]
s1
d
s2
Setting data
■Description, type, data type
Argument
EN
s1 (IN1), s2 (IN2)
ENO
d
Processing details
■Operation processing
• These functions search the string input to (s2) from the beginning of the string input to (s1), and output the search result
from (d).
• The start character position of the first string found is output as the search result.
• If the (s2) string is not found in the (s1) string, 0 will be output.
Upper byte
+0
42H(B)
+1
44H(D)
32H(2)
+2
34H(4)
+3
36H(6)
+4
00H
+5
Upper byte
+0
32H(2)
+1
34H(4)
+2
• Input a STRING data type value to (s1) and (s2) within the range of 0 to 255 bytes.
32 STRING FUNCTIONS
1960
32.8 Searching String Data
RnPCPU
RnSFCPU RnSFCPU
(Redundant)
(Standard)
(Safety)
[With EN/ENO]
EN
ENO
s1
s2
Description
Execution condition (TRUE: Executed, FALSE: Not executed)
Input
Output status (TRUE: Normal, FALSE: Abnormal)
Output
(s1)
ABCD1234567
Lower byte
41H(A)
43H(C)
31H(1)
33H(3)
35H(5)
37H(7)
(s2)
1234
Lower byte
31H(1)
33H(3)
00H
Structured text
[Without EN/ENO]
d:=FIND(s1,s2);
[With EN/ENO]
d:=FIND_E(EN,ENO,s1,s2);
d
Searching string data
Type
Data type
Input variable
BOOL
Input variable
ANYSTRING_SINGLE
Output variable
BOOL
Output variable
INT
(d)
5
INT

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents