ssRegisterStringDataType
Register string data type
Since R2020b
Syntax
DTypeId ssRegisterStringDataType(SimStruct *S, size_t maxStringLength)
Arguments
S
SimStruct that represents 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
.
Limitations
Non-inlined S-functions that contain string SimStruct functions do not run with rapid accelerator mode.
Languages
C, C++
Examples
This example registers a string data type.
int dtype; dtype = ssRegisterStringDataType(S, 128);
See Also
ssGetInputStringLength
, ssGetStringDataTypeMaxLength
, ssIsStringDataType
, ssReadInputString
, ssWriteOutputString
Version History
Introduced in R2020b