Constant
Constant value.
blockType: Constant
Path in the library:
|
Description
The Constant unit generates a real or complex constant value signal.
The unit generates the output signal as a scalar, vector, matrix or bus depending on the dimensionality of the parameters Constant value.
For more information about bus types, see User-defined bus types. |
The block output has the same dimensions and elements as the parameters Constant value.
Ports
Output
#
OUT_1
—
constant value
scalar
| vector
| matrix
| bus
Details
A constant value in the form of a real or complex scalar, vector, matrix or bus. By default, block Constant outputs a signal whose dimension and data type are the same as the parameters Constant value.
Data types |
|
Complex numbers support |
Yes |
Parameters
Main
# Constant value — constant value
Details
Set the output of the constant value of the block.
You can enter any value, including the logical keywords true
and false
.
Default value |
|
Program usage name |
|
Tunable |
Yes |
Evaluatable |
Yes |
#
Sample time —
interval between calculation steps
SampleTime (real number / vector of two real numbers)
Details
Sets the time interval during which the output signal of the Constant block may change during simulation (e.g. due to the setting of the parameter Constant value).
The by default value inf
indicates that the block output can never change. This value speeds up the simulation and the generated code by avoiding the need to recalculate the block output.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |
Signal Attributes
#
Output data type —
output data type
Inherit: auto
| Float64
| Float32
| Float16
| Int8
| UInt8
| Int16
| UInt16
| Int32
| UInt32
| Int64
| UInt64
| Int128
| UInt128
| Bool
| Fixed-point
| BusSignal
Details
Specify the type of output data. The type can be inherited or specified directly.
Values |
|
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
No |
#
Output fixed-point type —
fixed-point output data type
Data type
Details
Specify the fixed-point output type.
Dependencies
To use this parameter, set the Output data type parameters to Fixed-point
.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |
#
Output bus type —
output bus type
Data type
Details
Describes the type of bus that the unit outputs.
You can set the type yourself or enter the name of a variable that stores the type already created in vorkspace.
Dependencies
To use this parameter, set the Output data type parameter to BusSignal
.
Default value |
|
Program usage name |
|
Tunable |
No |
Evaluatable |
Yes |
Examples
-
Code generation for Arduino (linear frequency modulation with low pass filter)
-
Code generation for Arduino (Traffic lights on finite automata)
-
Code generation for STM32 (Button and flashing LED on finite automata)
-
Development of algorithmic embed code for air conditioner control system
-
Semi-natural modelling on RITM (Gate valve control via Modbus)
-
Defining diagram behaviour using state actions and transition labels