ReferenceControlArcReferenceStandard Librarycontrol

control

Arc standard library reference for the control module

The control module provides runtime control over write authority, letting a program promote or release writes that target shared channels. The authority declaration sets the values each channel starts with.

authority

Sets the control authority for the channels a program writes. authority is a keyword rather than a member of the module, so it needs no import. It must come before every func, sequence, and flow declaration in the program.

// Sets every channel the program writes to
authority 200

// Sets a default, then overrides two channels
authority (
    200
    valve_cmd 100
    vent_cmd 150
)

// Sets only these channels; the rest stay at 255
authority (
    valve_cmd 100
    vent_cmd 150
)

Authority values are u8 integers from 0 to 255. A program that declares no authority writes every channel at 255, the maximum.

set_authority

Changes the control authority of write channels at runtime. Higher values take priority, and 0 releases control.

control.set_authority{value: u8, channel?: chan}

Parameters

  • value: Authority level 0-255. Higher values take priority; 0 releases control.
  • channel: The write channel to target. If omitted, applies to all write channels.

Output

None; changes authority as a side effect and emits no value.

// Sets every channel the program writes to
trigger -> control.set_authority{value=255}

// Releases control of single channel
trigger -> control.set_authority{value=0, channel=press_vlv_cmd}

// Sets each channel to a different authority
stage emergency {
    control.set_authority{value=255, channel=press_vlv_cmd}
    control.set_authority{value=100, channel=vent_vlv_cmd}
}

Relationship to Manual Control

The default authority for a task that declares none is 255.

Schematics and other manual controls obey the same authority rules as an Arc task. Equal authority goes to whichever task, schematic, or process took control first, so an operator cannot take a channel from a task that already holds it. Declare an authority below 255 on every channel an operator may need to control by hand.

For practical patterns including emergency override, handoff between programs, and releasing control, see the Control Authority concept page.