> For the complete documentation index, see [llms.txt](https://docs.augelab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.augelab.com/function-blocks/blocks-reference/data-logic/logic/and.md).

# And

This function block performs a logical AND operation on two boolean inputs and outputs a single boolean result. It is used to combine two conditions: the output is True only when both inputs are True.

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

* `Boolean` (first input) Provide a boolean condition (e.g., result of a comparison or a manual boolean input).
* `Boolean` (second input) Provide a second boolean condition to combine with the first.

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

* `Boolean` Result of the AND operation. True when both inputs are True, otherwise False.

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

* `No Controls` This block has no adjustable widgets. It only evaluates the provided boolean inputs.

## ⚙️ Running mechanism <a href="#running-mechanism" id="running-mechanism"></a>

When the system runs, the block evaluates both boolean inputs and returns a single boolean output. The result reflects the logical AND of the two inputs: True only if both inputs are True. Use comparator blocks or boolean inputs upstream to produce the required boolean signals.

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

* Simple and reliable boolean combination for flow control and triggers.
* Works with comparator and boolean-producing blocks to build condition logic.
* Small and lightweight — ideal to use inside decision branches or to gate actions.

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

* Combine a detection check and a timer: feed a detection comparison (for example, use a `Greater` block on an `Object Count` output) into one input and a timing/enable boolean into the other to trigger actions only when both are satisfied.
* Ensure both inputs are boolean-producing blocks such as `Logic Input`, comparators (`Greater`, `Smaller`, `Equals`), or other logic blocks (`Not`, `Or`).

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

* To check that an object is present and a safety condition is met: use `Object Detection` (or `Object Detection - Custom`) → compare its `Object Count` with `Greater` → combine that result with a `Safety Equipment Detection` check using this `And` block.
* For multi-condition checks (more than two conditions), use `All True` to evaluate a list of boolean values, or chain multiple `And` blocks.
* Use `Not` to invert a condition before feeding into `And` if you need to require a negative condition (for example, "object present" AND "not alarmed").
* Use `Edge Rising` or `Rising Edge` when you want the `And` result to trigger only on a signal transition (combine the edge output with another boolean in this block).
* To toggle outputs (e.g., LEDs or logging) when combined conditions are met, feed this block's output to `Led Output`, `Image Logger`, `Image Write`, or `Record Video`.

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

* Unexpected False result: verify both upstream outputs are actual boolean values. Use `Logic Input` or comparator blocks (`Greater`, `Equals`, `Smaller`) to convert numeric outputs to boolean conditions.
* Unexpected True result: check that neither input is unintentionally True (e.g., default or uninitialized signals). Use `Is None` or `Data Type Converter` earlier in the chain to validate inputs.
* Need more than two conditions: either chain `And` blocks or use `All True` to evaluate a list of boolean values.
