Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

ssSetDataTypeSize

Set the size of a custom data type

Syntax

int_T ssSetDataTypeSize(SimStruct *S, DTypeId id, int_T size)

Arguments

S

SimStruct representing an S-Function block.

id

ID of the data type.

size

Size of the custom data type in bytes.

Returns

1 (true) if successful. Otherwise, returns 0 (false).

Description

Sets the size of the data type specified by id to size. Use this macro in mdlInitializeSizes to set the size of a data type you have registered. See Custom Data Types for more information on registering custom data types.

For more information about using custom data types in S-functions, see Custom Data Types.

Languages

C, C++

Example

The following example registers and sets the size of the custom data type named Color to 4 bytes.

int_T   status;
DTypeId id;

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

status = ssSetDataTypeSize(S, id, 4);
if(status == 0) return;

Introduced before R2006a

Was this topic helpful?