> ## Documentation Index
> Fetch the complete documentation index at: https://instro.nominal.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Flow Controller

> Using InstroFlowController for gas flow controllers

<Warning>This Instrument category is new and is currently available only in the Unstable package</Warning>

`InstroFlowController` provides a unified interface for gas flow controllers. This class is initialized with a vendor-specific driver (`AlicatMC`, …), and provides the vendor-agnostic API (`get_flow_data`, `set_setpoint`, `select_gas`, `tare_flow`, …).

## Creating an InstroFlowController

```python theme={null}
from instro.unstable.flowcontroller.drivers import AlicatMC
from instro.unstable.flowcontroller import InstroFlowController

fc = InstroFlowController(
    name="myFlowController",
    driver=AlicatMC("ASRL7::INSTR"),
)
```

A bare resource string applies the Alicat RS-232 defaults (19200 baud, carriage-return terminators). Pass a `VisaConfig` from `instro.lib.transports.visa` instead to override them, and `device_id` to address a unit other than `"A"`.

## Supported Vendors

<Columns cols={2}>
  <Card title="Alicat MC" horizontal href="/flowcontroller/AlicatMC">
    <img src="https://mintcdn.com/nominal/vd1fIohbHX0IE-nH/snippets/drivers/flowcontroller/alicat-mc/image.png?fit=max&auto=format&n=vd1fIohbHX0IE-nH&q=85&s=eb939602ccd884183e7dca3eba53ff9a" style={{ width: "100%", height: "100px", objectFit: "contain" }} noZoom alt="Alicat MC" width="500" height="141" data-path="snippets/drivers/flowcontroller/alicat-mc/image.png" />
  </Card>
</Columns>

If your vendor or model is not listed, see [Custom Driver Development](/library/custom-instruments#flow-controller), or open a [Driver Request](https://github.com/nominal-io/instro/issues) issue on GitHub.

## Example

More examples found in [Examples](/examples/unstable/index#flow-controller)

## Details

The following presents details about the `InstroFlowController`. Specific driver details can be found on [their pages](#supported-vendors).

### Driver Composition

An `InstroFlowController` is built from a concrete driver:

```python theme={null}
InstroFlowController(name="FlowController", driver=AlicatMC("ASRL7::INSTR"))
```

* The **vendor driver** (e.g. `AlicatMC`) owns the connection setup and vendor-specific command mapping.
* **`InstroFlowController`** owns the category-level workflow: measurements, commands, publishers, the background daemon.

### Lifecycle

The typical InstroFlowController workflow:

1. **Construct**: instantiate the vendor driver and pass it to `InstroFlowController`.
2. **`open()`**: establishes the VISA connection.
3. **Configure and measure**: select gas, set flow setpoint, tare flow (optional), and read flow data.
4. **`start()`**: begins a periodic background daemon. (Optional) By default this calls `get_flow_data` periodically.
5. **`stop()`**: ends the background daemon (if started).
6. **`close()`**: disconnects from hardware.

## Custom Driver Development

For more information on writing a custom driver, see [Custom Driver Development](/library/custom-instruments#flow-controller).
