
FC6A S
ERIES
MICROS
MART
L
ADDER
P
ROGRAMMING
M
ANUAL
FC9Y-B1726
26-39
26: S
CRIPT
Example 7.32
Search a string
Script
Operation Description
Searches for the search string "DEFG" that starts from D0200 in the string to be searched "ABCDEFGHIJKLMNO" that starts from
D0100 and stores the position of the occurrence of the string in D0000. If not found, -1 is stored in D0000.
If "?" is specified as a character to search for, it is handled as any single-byte character.
When specifying "?" (0x3F) as a character, specify it as "~?" (0x7E3F) in two bytes.
When specifying "~" (0x7E) as a character, specify it as "~~" (0x7E7E) in two bytes.
Note:
The maximum length of the search string is 128 characters.
When searching for "DEFG" and the string was found
When searching for "WXYZ" and the string was not found
[D0000] = STRSTR([D0100], [D0200]);
Search string
String to be searched
Search result
Device
Stored Value
Device
Stored Value
Position
Device Stored Value
D0200
Upper Byte
'D' = 0x44
D0100
Upper Byte
'A' = 0x41
0
D0000
3
Lower Byte
'E' = 0x45
Lower Byte
'B' = 0x42
1
D0201
Upper Byte
'F' = 0x46
D0101
Upper Byte
'C' = 0x43
2
Lower Byte
'G' = 0x47
Lower Byte
'D' = 0x44
←
3
D0202
Upper Byte
0x00
Terminating character
D0102
Upper Byte
'E' = 0x45
4
Lower Byte
0x00
Lower Byte
'F' = 0x46
5
D0103
Upper Byte
'G' = 0x47
6
Lower Byte
'H' = 0x48
7
D0104
Upper Byte
'I' = 0x49
8
Lower Byte
'J' = 0x4A
9
D0105
Upper Byte
'K' = 0x47
10
Lower Byte
'L' = 0x4C
11
D0106
Upper Byte
'M' = 0x4D
12
Lower Byte
'N' = 0x4E
13
D0107
Upper Byte
'O' = 0x4F
14
Lower Byte
0x00
Terminating character
Search string
String to be searched
Search result
Device
Stored Value
Device
Stored Value
Position
Device Stored Value
D0200
Upper Byte
'W' = 0x57
D0100
Upper Byte
'A' = 0x41
0
D0000
-1
Lower Byte
'X' = 0x58
Lower Byte
'B' = 0x42
1
D0201
Upper Byte
'Y' = 0x59
D0101
Upper Byte
'C' = 0x43
2
Lower Byte
'Z' = 0x5A
Lower Byte
'D' = 0x44
3
D0202
Upper Byte
0x00
Terminating character
D0102
Upper Byte
'E' = 0x45
4
Lower Byte
0x00
Lower Byte
'F' = 0x46
5
D0103
Upper Byte
'G' = 0x47
6
Lower Byte
'H' = 0x48
7
D0104
Upper Byte
'I' = 0x49
8
Lower Byte
'J' = 0x4A
9
D0105
Upper Byte
'K' = 0x47
10
Lower Byte
'L' = 0x4C
11
D0106
Upper Byte
'M' = 0x4D
12
Lower Byte
'N' = 0x4E
13
D0107
Upper Byte
'O' = 0x4F
14
Lower Byte
0x00
Terminating character
Содержание MICROSmart FC6A Series
Страница 1: ...B 1726 7 FC6A SERIES Ladder Programming Manual ...
Страница 8: ...Preface 7 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 32: ...1 OPERATION BASICS 1 20 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 96: ...3 INSTRUCTIONS REFERENCE 3 18 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 130: ...4 BASIC INSTRUCTIONS 4 34 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 158: ...6 DATA COMPARISON INSTRUCTIONS 6 10 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 192: ...9 SHIFT ROTATE INSTRUCTIONS 9 12 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 216: ...10 DATA CONVERSION INSTRUCTIONS 10 24 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 248: ...11 WEEK PROGRAMMER INSTRUCTIONS 11 32 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 272: ...12 DISPLAY INSTRUCTIONS 12 24 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 284: ...14 REFRESH INSTRUCTIONS 14 6 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 288: ...15 INTERRUPT CONTROL INSTRUCTIONS 15 4 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 294: ...16 COORDINATE CONVERSION INSTRUCTIONS 16 6 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 374: ...18 PULSE OUTPUT INSTRUCTIONS 18 78 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 Setting ...
Страница 450: ...20 DUAL TEACHING TIMER INSTRUCTIONS 20 4 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 502: ...25 DATA LOG INSTRUCTIONS 25 22 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 546: ...26 SCRIPT 26 44 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 574: ...27 FLOW CALCULATION INSTRUCTIONS 27 28 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 583: ...FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 28 9 28 USER DEFINED MACRO INSTRUCTION ...
Страница 584: ...28 USER DEFINED MACRO INSTRUCTION 28 10 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Страница 598: ...APPENDIX A 14 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...