0.60

ReferenceControlAuthority

Control authority

Learn how Synnax decides which writer controls a channel, and how to set it.

A writer is anything that sends values to a channel: a schematic, an Arc automation, a script, or a task. More than one writer can write to the same command channel, but only one writer at a time controls it. Control authority, a number from 0 to 255, decides which writer that is. With control authority, you can hand off control:

  • Between an operator and an automation.
  • Between two operators.
  • Between two automations, such as a nominal sequence and an abort sequence.

Arc automations and scripts write at 255 if you do not set an authority. An operator cannot take a channel from them, so give them a lower authority on each channel that an operator must be able to take. See default authorities.

How authority works

  1. Higher authority takes control

    When a writer opens on a channel, or raises its authority, with a higher authority than the controlling writer, it takes control.

  2. On equal authority, the first writer to open keeps control

    When two writers have the same authority, the one that opened on the channel first controls it. A writer that releases control and takes it again counts as a new writer.

  3. Control passes on when the controlling writer leaves

    When the controlling writer closes or lowers its authority, rules 1 and 2 pick the new controlling writer from the writers that are still open.

  4. Values from other writers are dropped

    Synnax ignores the values from a writer that does not control the channel. The writer gets no error.

  5. 255 is the highest authority

    A writer at 255 keeps control against every writer that opened after it.

  6. The index channel decides for its data channels

    A writer that loses control of an index channel loses its writes to every channel on that index, even the channels it controls.

Virtual channels

A virtual channel can have more than one writer at a time. Every writer with an authority equal to or higher than the controlling writer can write to it. For example, if a schematic and an Arc automation both write to a virtual press_vlv_cmd at 255, the values from both reach the channel.

Example: operator and abort

A Press sequence controls press_vlv_cmd, a command channel with an index. It writes at 100, and at 255 in its abort stage. An operator watches the test on a schematic that writes at 200, and at 255 from a control chip.

Controls the channelOpen, values dropped255Authority
  1. 1The Press sequence starts.Press sequence takes control. No other writer is open.
  2. 2The operator takes control.Schematic takes control. 200 is higher than 100.
  3. 3The operator releases control.Press sequence takes control. It is the only writer left.
  4. 4The operator takes control again.Schematic takes control. 200 is higher than 100.
  5. 5The Press sequence enters its abort stage.Press sequence takes control. 255 is higher than 200.
  6. 6The operator clicks the control chip (255).Press sequence keeps control. Equal authority, and it opened first.

In this recording, an automation named Valve Guard writes at 100, and a schematic at 200 takes control, opens the valve, and releases control. The legend shows which writer controls the valve at each step.

Set authority

Enterprise

Each schematic writes at one authority, 1 by default. To change it, see set the schematic authority.

See which writer controls a channel

On a schematic, the control chips and the control legend show which writer controls each channel. In code:

Enterprise
state = client.control.retrieve(name="press_vlv_cmd")
if state is None:
    print("No writer controls press_vlv_cmd")
else:
    print(state.subject.name, state.authority)

retrieve returns None when no writer controls the channel.

Default authorities

Writer Default Where to change it
Schematic 1 Schematic authority. Each Console keeps its own value. The schematic does not save it.
Schematic, after a click on a control chip 255 Cannot change
Arc automation 255 authority line
Python or TypeScript writer 255 authorities parameter
Read task and write task 255 Cannot change

A read task writes the channels it reads at 255, so a script cannot write to them while the task runs. A write task writes its state channels at 255.