Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Enumerated Constant

Generate enumerated constant value

Library

Sources

Description

The Enumerated Constant block outputs a scalar, array, or matrix of enumerated values. You can also use the Constant block to output enumerated values, but it provides block parameters that do not apply to enumerated types, such as Output minimum and Output maximum. When you need a block that outputs only constant enumerated values, preferably use Enumerated Constant rather than Constant. For more information, see About Simulink Enumerations.

Data Type Support

The Enumerated Constant block supports only enumerated data types. Use the Constant block to output constant data of other types. For more information, see Data Types Supported by Simulink.

Parameters and Dialog Box

The Enumerated Constant block dialog box initially appears as follows:

Output data type

The Output data type field specifies the enumerated type from which you want the block to output one or more values. The initial value, Enum: SlDemoSign, is a dummy enumerated type that prevents a newly cloned block from causing an error. To specify the desired enumerated type, select it from the pulldown or enter Enum: ClassName in the Output data type field, where ClassName is the name of the MATLAB® class that defines the type.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Value

The Value field specifies the value(s) that the block outputs. The output of the block has the same dimensions and elements as the Value parameter. The initial value, SlDemoSign.Positive, is a dummy enumerated value that prevents a newly cloned block from causing an error.

To specify the desired enumerated value(s), select from the pulldown or enter any MATLAB expression that evaluates to the desired result, including an expression that uses tunable parameters. All values specified must be of the type indicated by the Output data type. To specify an array that includes every value in the enumerated type, use the enumeration function.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Sample time

Specify the interval between times that the Constant block output can change during simulation (for example, due to tuning the Constant value parameter).

Settings

Default: inf

This setting indicates that the block output can never change. This setting speeds simulation and generated code by avoiding the need to recompute the block output. See Specify Sample Time for more information.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Characteristics

Direct Feedthrough

N/A

Sample Time

Specified in the Sample time parameter

Scalar Expansion

No

Dimensionalized

Yes

Multidimensionalized

Yes

Zero-Crossing Detection

No

Was this topic helpful?