---
url: /dyad/stable/stdlib/BlockComponents/components/Sources.IntegerConstant.md
description: Dyad Sources.IntegerConstant docs.  Generate constant signal of type Integer.
---

# `Sources.IntegerConstant` {#Sources.IntegerConstant}

Generate constant signal of type Integer.

The Integer output `y` is a constant signal equal to the parameter `k`.

Mirrors `Modelica.Blocks.Sources.IntegerConstant`.

This component extends from [`BlockComponents.Interfaces.IntegerSO`](../types/Interfaces.IntegerSO.md)

## Usage {#Usage}

`BlockComponents.Sources.IntegerConstant(k)`

## Parameters: {#Parameters:}

| Name |           Description | Units | Default value |
| ----:| ---------------------:| -----:| -------------:|
|  `k` | Constant output value |     – |               |

## Connectors {#Connectors}

* `y` - This connector represents an integer signal as an output from a component ([`IntegerOutput`](/stdlib/Dyad/connectors/IntegerOutput#IntegerOutput))

## Behavior {#Behavior}

$$ \begin{align}
y\left( t \right) &= k
\end{align}
$$

## Source {#Source}

```dyad
"""
Generate constant signal of type Integer.

The Integer output `y` is a constant signal equal to the parameter `k`.

Mirrors `Modelica.Blocks.Sources.IntegerConstant`.
"""
component IntegerConstant
  extends BlockComponents.Interfaces.IntegerSO
  "Constant output value"
  parameter k::Integer
relations
  y = k
metadata {
  "Dyad": {
    "labels": [
      {"label": "k = $(k)", "x": 500, "y": 1100, "rot": 0},
      {"label": "$(instance)", "x": 500, "y": -150, "rot": 0}
    ],
    "icons": {"default": "dyad://BlockComponents/IntegerConstant.svg"}
  }
}
end
```

```dyad
"""
Generate constant signal of type Integer.

The Integer output `y` is a constant signal equal to the parameter `k`.

Mirrors `Modelica.Blocks.Sources.IntegerConstant`.
"""
component IntegerConstant
  "Connector of Integer output signal"
  y = IntegerOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 1000, "y1": 450, "x2": 1100, "y2": 560, "rot": 0}
      },
      "tags": []
    }
  }
  "Constant output value"
  parameter k::Integer
relations
  y = k
metadata {
  "Dyad": {
    "labels": [
      {"label": "k = $(k)", "x": 500, "y": 1100, "rot": 0},
      {"label": "$(instance)", "x": 500, "y": -150, "rot": 0}
    ],
    "icons": {"default": "dyad://BlockComponents/IntegerConstant.svg"}
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses

* Tests
  * [`IntegerConstant`](Sources.IntegerConstant.md)

  * [`IntegerConstant`](Sources.IntegerConstant.md)

  * [`IntegerToReal`](Sources.IntegerConstant.md)
