# Constant (`constant`)

> Outputs one fixed value for the whole run.

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

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

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

## When to use it

Use it for a reference or limit that never changes. Use Step Source when the value must change at a set time.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `out` | signal | Fixed value, valid from the start |

## Common parameters

- `value`: Output value (Default: 0)

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `value` | — | 0 |  | Output value |

_Parameter descriptions are in English in both languages._

## Model

out = value at every step. The value has no unit of its own, so it takes the unit of the signal it feeds (A, V, rad/s or a duty fraction). It can be an expression of circuit variables.

## Common mistakes

- A Constant that feeds the duty input of a PWM Generator must stay between 0 and 1. Writing 50 for 50 percent keeps the switch on all the time.
- The default value is 0. A Constant that you place but never edit gives a zero reference without any warning.

Problems rules: `duty.out_of_range`

## Datasheet and sources

No datasheet applies. The value is a design target, such as a speed reference or a DC-link voltage, in the unit of the signal it feeds.

## Example

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

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