Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 1053

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Text String Processing Instructions
Example
D100
D200
D400
D300
3-31-7 FIND IN STRING: FIND$(660)
Purpose
Ladder Symbol
Variations
Applicable Program Areas
Operands
Note
1020
The maximum number of characters to be read that can be designated by S2
is 4,095 (0FFF hex). If more than that are designated, an error will be gener-
ated and the Error Flag will turn ON.
If 0 (0000 hex) is designated as the number of characters to be read, the two
NUL characters (0000 hex) will be output to D.
If 0000 (hex) is output to D, the Equals Flag will turn ON.
In this example, MID$(654) is used to read three characters.
Text string ABCDEFGHIJ
S1: D100
D101
D102
D103
D104
D105
Finds a designated text string from within a text string.
FIND$(660)
S1: Source text string first word
S1
S2
S2: Found text string first word
D
D: First destination word
Variations
Executed Each Cycle for ON Condition
Executed Once for Upward Differentiation
Executed Once for Downward Differentiation
Immediate Refreshing Specification
Block program areas
OK
OK
S1: Source Text String
15
S1
Text string data: 4,095 characters max. + NUL
to
S1 + maximum 2,047 words
S2: Found Text String
15
S2
Text string data: 4,095 characters max. + NUL
to
S2 + maximum 2,047 words
The data from S1 to S1 + the maximum 2,047 words and from S2 to S2 + the
maximum 2,047 words must be in the same area.
S2: D200
Three characters read.
S3: D400
From 5th character
(leftmost byte in D102).
Step program areas
Subroutines
OK
0
0
Section 3-31
Text string EFG
D: D300
FIND$(660)
@FIND$(660)
Not supported
Not supported
Interrupt tasks
OK

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents