Engee documentation

Constant

Constant value.

constant

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.

Usage in program code

Block parameter

Value

Value

scalar | vector | matrix

bus

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.

Usage in program code

Block parameter

SampleTime

Value

scalar | vector

By default

inf

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.

Usage in program code

Block parameter

OutDataTypeStr

Value

Inherit: Inherit from 'Constant value' | Inherit: auto | Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128 | Float16 | Float32 | Float64 | Bool | Fixed point

By default

Inherit: auto

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.

Usage in program code

Block parameter

OutputDataTypeStrFixed

Value

valid fixed point type description

By default

Fixed{Int16, 0}

Output bus type - output bus type


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.

Usage in program code

Block parameter

OutputDataTypesStrBus

Value

Bus type description

* By default*

BusSignal{(), Tuple{}, ()}

Block parameter OutputDataTypeStrBus Value bus type description By default BusSignal{(), Tuple{}, ()}

Additional options

C code generation: Yes

Examples