The leader in industrial automation and control solutions

Instruction Parameters

Supported PLC Series

PLC-AESPLC-FBPLC-ES

Supported Data Registers

MXYKLFTCSZRQD@DConstant
S
D
n

Supported Flags

FlagBitSupport
ErrorF11.0
ZeroF11.1
CarryF11.2

Number of Steps

Steps
4

Operands

OperandDescription
SThe first operand.
Entries are only WORD data registers.
This is the starting register to find the largest possible number.

The signed value range is -32,768 ~ 32,767 (216).
The unsigned value range is 0 ~ 65,535 (216-1).
The Hexadecimal value range is H0000 ~ HFFFF.
DThe second operand.
Entries are only WORD data registers.
This is where the minimum value found and its data register are saved.
This requires 3 WORD data registers.
nThe third operand.
Entries are WORD data registers or constants.
This is the amount of data registers to search through starting at D.

The value range is 1 ~ 32,767 (215-1).

Notice

Error Flag (F11.0) Notice

The error flag, F11.0, will be ON for one scan when the address of the data register assigned by @D exceeds the range of the data register, D. The range of the data register, D, is dependent on the CPU type. F11.0 turns ON when the value of the data for n exceeds the value range 1 ~ 32,767 (215-1).

Instruction Behavior

The MIN and MINP instructions behave as follows:

  • Both instructions require 3 data registers starting at the data register, D.
    • D saves the minimum number found in the search range.
    • D+1 saves the first occurrence index of the minimum number found in the search range.
    • D+2 saves the amount of times the minimum number was found in the search range.
  • If n is less than 1 or greater than 32,767, neither instruction will execute.

Ladder Diagram Examples

MIN

The MIN instruction searches n number of WORD data registers, starting at S, for the minimum possible value. The result of the search is saved in 3 as

The MIN instruction searches n number of WORD data registers, starting at S, for the minimum possible value. The result of the search is saved in 3 assigned WORD data registers starting at D.

When the contact, M1.0 is ON (1), the instruction finds the minimum WORD value of 3 data registers, D0, D1, and D2.

When the contact, M1.0 is ON (1), the instruction finds the minimum WORD value of 3 data registers, D0, D1, and D2. The smallest value found is saved in D4. The position in which the data register was found is saved in D5. The total amount of times the number is found is saved in D6.

Ladder Diagram Example for MapleLogic MIN/MINP instruction.

Result

Result for MapleLogic MIN/MINP instruction.

MINP

The MINP one-shot instruction searches n number of WORD data registers, starting at S, for the minimum possible value. The result of the search is sav

The MINP one-shot instruction searches n number of WORD data registers, starting at S, for the minimum possible value. The result of the search is saved in 3 assigned WORD data registers starting at D. Every time this instruction executes, it energizes the output only once.

When the contact, M1.1 is ON (1), the instruction finds the minimum WORD value of 5 data registers, D6, D7, D8, D9, and D10.

When the contact, M1.1 is ON (1), the instruction finds the minimum WORD value of 5 data registers, D6, D7, D8, D9, and D10. The smallest value found is saved in D12. The position in which the data register was found is saved in D13. The total amount of times the number is found is saved in D14.

Ladder Diagram Example for MapleLogic MIN/MINP instruction.

Result

Result for MapleLogic MIN/MINP instruction.