Main Content

ssRegisterStringDataType

Register string data type

Syntax

DTypeId ssRegisterStringDataType(SimStruct *S, size_t maxStringLength)

Arguments

S

SimStruct representing an S-Function block.

maxStringLength

Maximum length of string.

Returns

The DTypeId associated with the registered data type. Otherwise, reports an error and returns INVALID_DTYPE_ID.

Description

ssRegisterStringDataType registers a string data type. If ssGetStringDataTypeMaxLength is 0, the string has no maximum length (dynamic string). Each data type must be a valid MATLAB® identifier, that is, the first character is an alpha and all subsequent characters are alphanumeric or "_". The name length must be less than 32. Data types must be registered in mdlInitializeSizes.

Note

You can call this function to get the data type ID associated with a registered data type. For a list of built-in values for the data type ID, see ssGetInputPortDataType.

Languages

C, C++

Example

This example registers a string data type.

int dtype;
dtype = ssRegisterStringDataType(S, 128);
Introduced in R2020b