339
Special Math Instructions
Section 5-23
Limitations
N must be BCD between 0001 to 9999.
R
1
and R
1
+N–1 must be in the same data area.
DM 6144 to DM 6655 cannot be used for D.
Description
When the execution condition is OFF, MAX(––) is not executed. When the
execution condition is ON, MAX(––) searches the range of memory from R
1
to
R
1
+N–1 for the address that contains the maximum value and outputs the
maximum value to the destination word (D).
If bit 15 of C is ON, MAX(––) identifies the address of the word containing the
maximum value in D+1. The address is identified differently for the DM area:
1,2,3...
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.
If bit 14 of C is ON and more than one address contains the same maximum
value, the position of the lowest of the addresses will be output to D+1. The
position will be output as the DM address for the DM area, but as an absolute
position relative to the first word in the range for all other areas.
The number of words within the range (N) is contained in the 3 rightmost dig-
its of C, which must be BCD between 001 and 999.
When bit 15 of C is OFF, data within the range is treated as unsigned binary
and when it is ON the data is treated as signed binary.
!Caution
If bit 14 of C is ON, values above #8000 are treated as negative numbers, so
the results will differ depending on the specified data type. Be sure that the
correct data type is specified.
Flags
ER:
Indirectly addressed EM/DM word is non-existent.
(Content of
*
EM/
*
DM word is not BCD, or the EM/DM area boundary
has been exceeded.)
R
1
and R
1
+N–1 are not in the same data area.
EQ:
ON when the maximum value is #0000.
15 14 13 12 11
00
Data type
1 (ON): Signed binary
0 (OFF): Unsigned binary
Number of words
in range (N)
Not used set to zero.
Output address to D+1?
1 (ON): Yes.
0 (OFF): No.
C:
Содержание SYSMAC CQM1H Series
Страница 3: ...iv...
Страница 5: ...vi...
Страница 9: ......
Страница 11: ......
Страница 15: ...xvi...
Страница 87: ...62 Calculating with Signed Binary Data Section 1 7...
Страница 169: ...144 Serial Communications Board Section 2 6...
Страница 537: ......
Страница 565: ......
Страница 569: ......
Страница 573: ......
Страница 577: ......