Main Content

Simulink.Block.getInternalDataType

Get data type of block parameter

Since R2023a

Description

dataType = Simulink.Block.getInternalDataType(block,parameter,mode) returns the data type of block parameter when its value is set to Inherit: Inherit via internal rule. Specify mode to compile or not compile the model before returning the data type.

dataType = Simulink.Block.getInternalDataType(block,parameter) returns the data type of the parameter from the previous model compilation.

example

Examples

collapse all

Return the data type for the Gain block of the slex_getInternalDataType model.

Gain Block ParamDataTypeStr Parameter with Uncompiled Model

Return the data type for the ParamDataTypeStr parameter in the Gain block.

Set model to slex_getInternalDataType.

model='slex_getInternalDataType';

Load slex_getInternalDataType.

load_system('slex_getInternalDataType');

Get the data type of the Gain block with uncompiled model.

dataType=Simulink.Block.getInternalDataType([model, '/Gain'],...
     'ParamDataTypeStr','cached')
dataType = 
'auto'

Gain Block ParamDataTypeStr Parameter with Compiled Model

Get the data type of the Gain block with compiled model.

dataType=Simulink.Block.getInternalDataType([model, '/Gain'],...
     'ParamDataTypeStr','compiled')
dataType = 
'ufix16_En15'

Input Arguments

collapse all

Block, specified as a character vector or block handle.

Example: [model,'/Gain']

Block parameter programmatic name, specified as character vector or string. This parameter must be set to Inherit: Inherit via internal rule in the model.

Example: 'ParamDataTypeStr'

Data Types: char | string

Model compilation, specified as:

  • cached — Return data before model is compiled.

  • compiled — Return data after model is compiled.

The function compiles the model based on this setting.

Example: 'cached'

Output Arguments

collapse all

Data type of parameter, returned as a scalar character vector.

Limitations

This function returns the data type for only these blocks:

  • SqrtIntermediateResultsDataTypeStr

  • 1-D Lookup Table block, 2-D Lookup Table block, and n-D Lookup Table block — IntermediateResultsDataTypeStr or FractionDataTypeStr

  • GainParamDataTypeStr

Version History

Introduced in R2023a