Special Math Instructions - Omron CPM1 - PROGRAMING MANUAL 02-2001 Programming Manual

Hide thumbs Also See for CPM1 - PROGRAMING MANUAL 02-2001:
Table of Contents

Advertisement

Special Math Instructions

Flags
7-23 Special Math Instructions
7-23-1 DATA SEARCH – SRCH(––)
SRCH(––)
N
R
1
C
Limitations
Description
1, 2, 3...
Flags
Example
ER:
Dr contains 0.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
EQ:
ON when the result is 0.
Ladder Symbols
@SRCH(––)
N
R
1
C
This instruction is available in the CPM2A/CPM2C only.
N must be BCD between 0001 to 9999.
R
and R
+N–1 must be in the same data area.
1
1
DM 6144 to DM 6655 cannot be used for C.
When the execution condition is OFF, SRCH(––) is not executed. When the
execution condition is ON, SRCH(––) searches the range of memory from R
R
+N–1 for addresses that contain the comparison data in C. If one or more ad-
1
dresses contain the comparison data, the EQ Flag (SR 25506) is turned ON and
the lowest address containing the comparison data is identified in C+1. The ad-
dress is identified differently for the DM area:
1. For an address in the DM area, the word address is written to C+1. For ex-
ample, if the lowest address containing the comparison data is DM 0114,
then #0114 is written in C+1.
2. For an address in another data area, the number of addresses from the be-
ginning of the search is written to C+1. For example, if the lowest address
containing the comparison data is IR 114 and the first word in the search
range is IR 014, then #0100 is written in C+1.
If none of addresses in the range contain the comparison data, the EQ Flag
(SR 25506) is turned OFF and C+1 is left unchanged.
Indirectly addressed DM word is non-existent. (Content of *DM word is
ER:
not BCD, or the DM area boundary has been exceeded.)
N is not BCD between 0001 and 9999.
R
and R
1
EQ:
ON when the comparison data has been matched in the search range.
In the following example, the 10 word range from IR 200 to IR 209 is searched
for addresses that contain the same data as DM 0100 (89AB). Since IR 204 con-
IR, SR, AR, DM, HR, TC, LR, #
IR, SR, AR, DM, HR, TC, LR
C: Comparison data, result word
+N–1 are not in the same data area.
1
Section
Operand Data Areas
N: Number of words
R
: First word in range
1
IR, SR, AR, DM, HR, LR
7-23
to
1
471

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents