# Arc

> Learn what Arc is, what it is for, where it runs, and when to use it.

![](https://synnax.nyc3.cdn.digitaloceanspaces.com/docs/control/arc/hero/130fa9a61b04/window-light.webp)

Arc is the Synnax language for automations. An Arc automation reads channels, computes values, and writes channels. It runs on the Synnax Core or on a Driver, where the data arrives, so its timing does not depend on your computer or the network. You write Arc in the Console, as text or as a graph of blocks.

## What Arc is for

* [Test sequences](https://docs.synnaxlabs.com/reference/control/arc/test-sequences) -> Open and close valves in stages, and go to an abort stage on unsafe values.
* [Bang-bang control](https://docs.synnaxlabs.com/reference/control/arc/bang-bang-control) -> Hold a value between a low and a high limit.
* [Computed values](https://docs.synnaxlabs.com/reference/control/arc/compute-values) -> Write averages, rates of change, and unit conversions to channels that Synnax stores.
* [Alarms](https://docs.synnaxlabs.com/reference/alarms/arc) -> Set a status when a value goes out of limits.

## Flows

A flow sends values from channels, through expressions, to a channel with `->`. The flow runs each time one of its channels gets a new value, after each channel has its first value. This flow writes the average of two pressure sensors to a third channel:

```arc
(tank_pt_1 + tank_pt_2) / 2 -> tank_pt_avg
```

## Sequences

A sequence runs its steps in order: writes, waits, and stages. A stage holds until one of its conditions is true, and `=> next` moves the sequence on. When the last step finishes, the sequence stops, and `start_cmd` can start it again. This sequence runs each time `start_cmd` becomes 1:

```arc
import time

sequence press {
    stage pressurize {
        1 -> press_vlv_cmd
        tank_pt > 300 => next
    }
    0 -> press_vlv_cmd
    time.wait(duration=10s)
    stage vent {
        1 -> vent_vlv_cmd
        tank_pt < 5 => next
    }
    0 -> vent_vlv_cmd
}

start_cmd == 1 => press
```

See the [execution model](https://docs.synnaxlabs.com/reference/control/arc/execution-model) for how stages, conditions, and writes run.

## Where an Arc automation runs

You choose where each automation runs in its **Driver** list:

* **The Core** -> The entry `Node 1` (or the number of your Core) runs the automation inside the Core. It needs no Driver. When the automation has an error while it runs, the Core logs a warning and keeps it running.
* **A [Driver](https://docs.synnaxlabs.com/reference/hardware#where-the-driver-runs)** -> The entry `Node 1 Embedded Driver` is the Driver that runs with the Core. A standalone Driver shows with the name of its computer. A Driver runs the automation next to the hardware it connects to, and can run it on a real-time loop. When the automation has an error while it runs, the Driver stops it.

Enterprise

You can also run automations on a [standalone Driver](https://docs.synnaxlabs.com/reference/hardware#where-the-driver-runs) on a different computer, such as an NI Linux Real-Time controller.

## Text and graph editors

When you create an Arc automation, you choose its **Editor mode**. You cannot change it later.

* **Text** -> You write Arc code. Use it for sequences and for automations with many conditions.
* **Graph** -> You connect blocks for channels, comparisons, and statuses. Use it for simple automations, such as alarms.

## Arc, calculated channels, or Python

| Use                                                                                       | To                                                                        | Runs                                      |
| ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ----------------------------------------- |
| [Calculated channel](https://docs.synnaxlabs.com/reference/channels/calculated)           | Show a value computed from other channels, live or over past data.        | While something streams or reads it.      |
| Arc automation                                                                            | Run sequences and control loops, store computed values, and set statuses. | From when you start it until you stop it. |
| [Python script](https://docs.synnaxlabs.com/reference/control#ways-to-control) Enterprise | Use Python libraries, or connect to other software.                       | On your computer, while the script runs.  |
