# Toggle

> A switch over a Boolean point that follows the plant: the click writes, the plant confirms.

**Toggle** is a switch over one writable Boolean point. It follows the SCADA rule of state
ownership: the visual *follows the point*, refreshed from the live address space, and
the click only writes the negation of what the point currently says; the switch flips
when the plant confirms. The screen never shows a state the point did not report. It is
a *Control* component; a new one occupies 4 × 1 cells.

## Content {#content}

| Field | What it does | Values | Default |
|---|---|---|---|
| Label | Optional caption drawn beside the switch. | Free text | empty |

## Data {#data}

| Field | What it does | Values | Default |
|---|---|---|---|
| Address | The rooted Logic address of the switched point: a memory variable or a writable tag. The suggestion list leads with Boolean points. | Free text; suggestions from the live point list | empty |

Under the field, the editor shows what the chosen point reads right now.

## When the switch can be operated {#when-the-switch-can-be-operated}

The switch is enabled only while all of these hold:

- the point resolves to a **legal write target**: a memory variable (not an expression
  variable, whose value is computed) or a tag that is not read-only;
- the point is reading in **good quality**: the click writes the *negation* of the
  current state, so with no trustworthy reading there is nothing to negate;
- no write from this switch is still in flight;
- the signed-in role **may operate dashboards** (see the permission model on the
  [dashboards page](home)). A role that may not shows the quiet lock mark instead, with
  the reason in the component's tooltip.

## Write semantics {#write-semantics}

One click writes `true` or `false` (always the opposite of the point's last good
reading) through the station's single logic write funnel, journaled like every other
write. The transient answer line under the switch reports the outcome ("On written",
"Off written", or the error) and clears itself after a few seconds. In a cell with no line
for it and no corner title standing over the switch, the answer is written in the label's
place beside the switch while it shows, a refusal in the error ink, with the whole answer in
the tooltip; the switch does not move, the label comes back when the answer clears, and a
switch with no label holds the same place for it. Authorization is re-checked at the moment
of the click, so a role change or sign-out with the screen open cannot dispatch a stale
press.

The switch is the one that waits for the equipment, not the Logic, so "On written" means
the equipment took it. Anything else puts the refusal on that line in the words of whoever
refused it: the station's own for what it settled before sending ("'Cmd' was not written:
the device is not connected.") and the equipment's or its driver's for what happened on
the wire. A state that a newer write to the same point overtook before it was sent is not
a refusal and is reported as written, because the newer state is the one the plant is
given.

If the bound point fails to read (unresolved address, or bad quality), the component
wears the shared bad-reading mark and the switch is disabled until the reading returns.

The shared Appearance, Identification, Position and layer and Actions sections are
described on the [components page](components#the-shared-property-sections).
