# Maximum

This function block finds the largest value among a configurable set of numeric inputs and returns both that value and its position.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

`Values`\
One or more numeric values (provided as individual inputs or a list). The number of available input sockets can be adjusted using the control below.

## 📤 Outputs <a href="#outputs" id="outputs"></a>

`Number`\
The highest numeric value found among the provided inputs.

`Index`\
The position (zero-based index) of the highest value within the provided inputs.

## 🕹️ Controls <a href="#controls" id="controls"></a>

`Input size`\
Choose how many numeric inputs are available (for example, from 2 up to the configured maximum). Changing this adjusts how many values you can feed into the block.

## 🎨 Features <a href="#features" id="features"></a>

* Dynamic input sizing — easily change how many numeric inputs the block accepts to match your data layout.
* Dual outputs — returns both the maximum value and its corresponding index so you can use either result in downstream logic.
* Works with lists or individual value sockets when available.

## 📊 Running mechanism <a href="#evaluation" id="evaluation"></a>

When the flow runs, the block examines the connected numeric inputs and determines the maximum value and its position. Only active/connected inputs are considered. If multiple inputs share the same maximum value, the index for the first occurrence is returned.

## 📝 Usage Instructions <a href="#usage" id="usage"></a>

1. Set the number of inputs with the `Input size` control to match how many values you will provide.
2. Connect numeric sources (or a list of numbers) to the `Values` inputs.
3. Read the `Number` output to get the maximum value and `Index` to get its position.
4. Feed those outputs to other blocks to drive logic, visualization or logging.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

* Use `Get Element` to extract a specific value from a list before or after the `Maximum` block when working with batched data.
* Combine with `Batch Processing` and `Get Batch Size` when working on large lists or streaming data to lower memory usage and control how values are fed to the block.
* Send numeric outputs to `Scope` to visualize live value streams and easily spot trends or spikes.
* To compute a range, use `Minimum` alongside this block and then `Subtract` the results to get max−min.
* Store results with `Data Memory` if you need to freeze or hold a maximum value for later comparison.

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* No valid result: ensure at least one numeric input is connected.
* Unexpected index when values tie: the returned `Index` corresponds to the first occurrence of the maximum.
* Non-numeric inputs will prevent meaningful results — verify source blocks provide numbers.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.augelab.com/function-blocks/data-logic/mathmetical-operations/maximum.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
