Constant
Constant value.
Description
The Constant block generates a real or complex constant value signal.
The block generates a scalar, vector or matrix output depending on the dimensionality of the Constant value parameter.
The block output has the same dimensions and elements as the Constant value parameter.
Ports
Output
Port_1 - constant value
scalar
| vector
| matrix
| bus
A constant value in the form of a real or complex scalar, vector, matrix or bus. By default, the Constant block outputs a signal whose dimensions, data type and complexity are the same as those of the Constant value parameter.
Data types: Float16
, Float32
, Float64
, Int8
, Int16
, Int32
, Int64
, Int128
, UInt8
, UInt16
, UInt32
, UInt64
, UInt128
, Bool
, Fixed point
, BusSignal
.
Support for complex numbers: Yes
Parameters
Main
Constant Value - constant value
1.0 (by default)
| scalar
| vector
| matrix
| bus
Set the constant value output of the block.
You can enter any expression that will be treated as a matrix, including the logical keywords true
and false
.
Block parameter |
|
Value |
|
|
By default |
Sample time - interval between calculation steps
inf (by default)
| scalar
| vector
Specifies the time interval during which the output of the Constant block may change during the simulation (e.g. due to the setting of the Constant value parameter).
The by default value inf
specifies 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.
Block parameter |
|
Value |
|
By default |
|
Signal Attributes
Output data type - output data type
Inherit: auto
| Int8
| Int16
| Int32
| Int64
| Int128
| UInt8
| UInt16
| UInt32
| UInt64
| UInt128
| Float16
| Float32
| Float64
| Bool
| Fixed-point
| BusSignal
Specify the type of the output data. The type can be inherited, specified directly, or expressed as a datatype object.
Block parameter |
|
Value |
|
By default |
|
Output fixed-point type - output fixed-point number type
Fixed{Int16, 0} (by default)
| description of fixed-point data type
Specify the output type of fixed-point numbers.
Dependencies
Turns ON when the Output data type parameter is set to Fixed point
.
Block parameter |
|
Value |
|
By default |
|
BusSignal{(), Tuple{}, ()} (By default)
| Bus type description
Details
Describes the type of bus the block outputs.
Dependencies
To specify the output bus type, set the Output data types
parameter to BusSignal
. After that, the Output bus type field will appear in which you must enter the bus type (BusSignal{…}
). You can write the type yourself or enter the name of a variable that stores the type already created in vorkspace.
Block parameter |
|
Value |
|
* By default* |
|
Block parameter OutputDataTypeStrBus Value bus type description By default BusSignal{(), Tuple{}, ()}
Examples
-
Development of algorithmic embed code for air conditioner control system
-
Automating the calculation of sunrise and sunset times for using callbacks
-
Defining diagram behaviour using state actions and transition labels
-
Semi-natural modelling on RITM (Gate valve control via Modbus)
-
Code generation for Arduino (linear frequency modulation with low pass filter)
-
Code generation for STM32 (Button and flashing LED on finite automata)
-
Code generation for Arduino (Traffic lights on finite automata)