# Midas Slow Control Bus

MSCB is a compact, self-documenting field bus for experiment slow control. It
connects a PC through a submaster to RS-485 nodes that expose typed variables
for measurements, demand values, configuration, and diagnostics.

<div class="grid cards" markdown>

-   :material-transit-connection-variant:{ .lg .middle } **Understand the bus**

    ---

    Learn the addressing model, node variables, submasters, and RS-485
    topology.

    [:octicons-arrow-right-24: Architecture](overview/architecture.md)

-   :material-code-braces:{ .lg .middle } **Implement the protocol**

    ---

    Use the byte-level command, response, CRC, timing, and UDP transport
    specifications.

    [:octicons-arrow-right-24: Protocol](protocol/index.md)

-   :material-console:{ .lg .middle } **Operate a network**

    ---

    Discover submasters, scan nodes, inspect variables, save configurations,
    and upgrade firmware.

    [:octicons-arrow-right-24: Getting started](getting-started.md)

-   :material-api:{ .lg .middle } **Build applications**

    ---

    Consult the C, C++, and Python APIs, status codes, and complete `msc`
    command reference.

    [:octicons-arrow-right-24: API reference](reference/c-api.md)

</div>

## Documentation scope

This site documents the MSCB bus and the current repository:

- the complete protocol tables, including command encoding, responses,
  variable metadata, units, and timing;
- Ethernet submaster UDP framing and authentication derived from the current
  implementation;
- current C, C++, and Python usage;
- a function-by-function reference for `src/mscb.cxx`; and
- a command reference derived from `src/msc.cxx`.

## At a glance

| Property | Value |
|---|---|
| Physical node bus | Half-duplex RS-485 |
| Address space | 16-bit node and group addresses |
| Nodes per address space | Up to 65,536 |
| Direct nodes per 1/8-load segment | Up to 256 |
| Variables per node | Up to 256, indexed 0–255 |
| Current protocol version | 5 |
| Ethernet submaster transport | UDP, default port 1177 |
| Data integrity | CRC-8, polynomial x⁸ + x⁵ + x⁴ + 1 |
