Omron CPM1 - PROGRAMING MANUAL 02-2001 Programming Manual page 490

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

Advertisement

Special Math Instructions
00000
DM 0100
IR 200
IR 201
IR 202
IR 203
IR 204
IR 205
IR 206
IR 207
IR 208
IR 209
7-23-2 FIND MAXIMUM – MAX(––)
MAX(––)
C
R
1
D
Limitations
Description
1, 2, 3...
472
tains the same data, the EQ Flag (SR 25506) is turned ON and #0004 is written
to DM 0101.
@SRCH(––)
#0010
200
DM 0100
89AB
1234
5678
Offset: 0004
ABCD
EF13
Search data found
89AB
8860
90CD
00FF
Search data found
89AB
810C
Note The matching search data in IR 208 is ignored because the search data was
found in an earlier word in the range.
Ladder Symbols
@MAX(––)
C
R
1
D
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 D.
When the execution condition is OFF, MAX(––) is not executed. When the
execution condition is ON, MAX(––) searches the range of memory from R
R
+N–1 for the address that contains the maximum value and outputs the maxi-
1
mum value to the destination word (D).
The address 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 address containing the maximum value is DM 0114, then #0114
is written in D+1.
2. For an address in another data area, the number of addresses from the be-
ginning of the search is written to D+1. For example, if the address contain-
ing the maximum value is IR 114 and the first word in the search range is
IR 014, then #0100 is written in D+1.
Address Instruction
00000
LD
00001
@SRCH(––)
Offset of first word con-
taining the search data
Operand Data Areas
IR, SR, AR, DM, HR, TC, LR, #
R
IR, SR, AR, DM, HR, TC, LR
IR, SR, AR, DM, HR, LR
Section
Operands
00000
#
0010
0200
DM
0100
DM 0101
0004
C: Control data
: First word in range
1
D: Destination word
7-23
to
1

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CPM1 - PROGRAMING MANUAL 02-2001 and is the answer not in the manual?

Questions and answers

Table of Contents