Main Content

ssGetDataTypeId

Get the ID of a data type

Syntax

DTypeId ssGetDataTypeId(SimStruct *S, char *name)

Arguments

S

SimStruct representing an S-Function block.

name

Name of a data type.

Returns

The ID of the custom data type specified bynameifnameis a registered type name. Otherwise, returnsINVALID_DTYPE_IDand reports an error.

Description

Use to obtain the data type ID of a custom data type.

Note

Because this macro reports any error that occurs, you do not need to usessSetErrorStatusto report the error.

关于使用自定义数据类型的更多信息in S-functions, seeConfigure Custom Data Types.

Languages

C, C++

Example

The following example gets the ID of the data type namedColor.

int_T id = ssGetDataTypeId (S, "Color"); if(id == INVALID_DTYPE_ID) return;

Version History

Introduced before R2006a