# Bus Selector (`busSelect`)

> Picks some elements of a bus, in any order, as a smaller bus or a single signal.

![busSelect](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/img/busSelect.svg)

[Component reference](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/) · [繁體中文](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/control/busSelect/)

**Group:** Control · **Kind:** `{"block":"busSelect","kind":"control"}`

## When to use it

Use it to take the d axis out of a dq bus, reorder phases (`3, 2, 1`), or pass two of six gate signals on, without splitting the whole bus.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `in` | signal | The bus to pick from. |
| `out` | signal | The picked elements as a bus, or the element itself when one is picked. |

## Common parameters

- `index`: Elements of the bus to pick, 1-based and comma separated: `1, 3` gives a bus of two, `2` a scalar (Default: optional (off))

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `index` | — | optional (off) |  | Elements of the bus to pick, 1-based and comma separated: `1, 3` gives a bus of two, `2` a scalar |

_Parameter descriptions are in English in both languages._

## Model

Element k of the output is element index(k) of the input, counted from 1. The block is wiring and adds nothing to the simulation.

## Common mistakes

- Indices count from 1, not from 0, and must not pass the width of the bus; an index past it is an error that names the block.
- Picking one element gives a scalar, which an ordinary block can read; picking several gives a bus, which only element-wise blocks and pin groups take.

## Datasheet and sources

There is no datasheet. `index` lists the element numbers, for example `1, 3`.

## Example

Open the example with the command `file.openExample` and the name `demo:busSelect`.

---
Generated by `cargo xtask reference` from the usage texts and parameter specs. Do not edit by hand.
