Max & Min Function

Owning Palette: Comparison Functions

Requires: Base Development System

Compares x and y and returns the larger value at the top output terminal and the smaller value at the bottom output terminal. This function accepts time stamp values if all inputs are time stamp values. If the inputs are time stamp values, the function returns the later time at the top and the earlier time at the bottom. You can change the comparison mode of this function.

The connector pane displays the default data types for this polymorphic function.

Details  Example

 Add to the block diagram  Find on the palette
x and y must be of the same type.
max(x, y) is the larger value. When you compare arrays in Compare Elements mode (default), this function compares corresponding elements in each input array and returns the element with the maximum value. max(x, y) is an array consisting of the maximum value elements. When you compare arrays in Compare Aggregates mode, this function compares corresponding elements in each input array starting at the beginning of the array. When this function reaches a pair of unequal corresponding elements, max(x, y) returns the array that has the greater value for that element.
min(x, y) is the smaller value. When you compare arrays in Compare Elements mode (default), this function compares corresponding elements in each input array and returns the element with the minimum value. min(x, y) is an array consisting of the minimum value elements. When you compare arrays in Compare Aggregates mode, this function compares corresponding elements in each input array starting at the beginning of the array. When this function reaches a pair of unequal corresponding elements, min(x, y) returns the array that has the smaller value for that element.

Max & Min Details

Behavior When Comparing NaN Elements

In Compare Elements mode, when one or both inputs are NaN (Not-a-Number), this function produces the following results:

In Compare Aggregates mode, when one or both inputs are NaN (Not-a-Number), this function produces the following results:

Example

Refer to the Max and Min VI in the labview\examples\Comparison directory for an example of using the Max & Min function.

 Open example  Find related examples