3. Instructions
588
CS/CJ/NSJ Series Instructions Reference Manual (W474)
MAX/MIN
Applicable Program Areas
Operands
z Operand Specifications
Instruction Mnemonic Variations
Function
code
Function
FIND MAXIMUM MAX @MAX 182 Finds the maximum value in the range.
FIND MINIMUM MIN @MIN 183 Finds the minimum value in the range.
Symbol
MAX MIN
Area
Function block
definitions
Block program areas Step program areas Subroutines Interrupt tasks
SFC action or
transition programs
Usage OK OK OK OK OK OK
Operand Description Data type Size
C First control word UDINT 2
R1 First word in range UINT Variable
D Destination word UINT 1
C: First control word R1: First word in range
Note C and C+1, R1 and R1+(W-1) must be in the
same data area.
Area
Word addresses
Indirect DM/EM
addresses
Con-
stants
Registers Flags
Pulse
bits
TR
bits
CIO WR HR AR T C DM EM
@DM
@EM
*DM
*EM
DR IR
Indirect
using IR
TK CF
C
OK OK OK OK OK OK OK OK OK OK
OK
---
--- OK --- --- --- ---R1
---
D OK
C: First control word
R1: First word in range
D: Destination word
MAX(182)
C
R1
D
C: First control word
R1: First word in range
D: Destination word
MIN(183)
C
R1
D
15 0
C
15 014
0
C+1
13
00 0000 0000 0000
Output selection
Data type
0: Does not output address to IR0.
1: Outputs address to IR0.
0: Unsigned binary data
1: Signed binary data
W: Number of words in range
&1 to &65535 (decimal) or
#0001 to #FFFF (hex)
R1
R1+(W–1)
15 0
---to
Search range