ssGetDataTypeSize

Get the size of a custom data type

Syntax

int_T ssGetDataTypeSize(SimStruct *S, DTypeId id)

Arguments

S

SimStruct representing an S-Function block.

id

ID of a data type.

Returns

An int_T value indicating the size of the data type specified by id, if id is valid and the data type's size has been set. Otherwise, returns INVALID_DTYPE_SIZE and reports an error.

Description

Use to obtain the size of a custom data type.

    Note   Because this macro reports any error that occurs when it is invoked, you do not need to use ssSetErrorStatus to report the error.

The Simulink® Coder™ product does not support S-functions that contain custom data types. Attempting to generate code for a model that contains this macro results in an error.

Languages

C, C++

Example

The following example gets the size of the int16 data type.

int_T size = ssGetDataTypeSize(S, SS_INT16);
if(size == INVALID_DTYPE_SIZE) return;
Was this topic helpful?