Writing S-Functions | ![]() ![]() |
Set the size of a custom data type.
Syntax
Arguments
S
SimStruct representing an S-Function block.
size
Size of the custom data type in bytes.
Description
Sets the size of the data type specified by id
to size
. If the call is successful, the macro returns 1 (true), otherwise, it returns 0 (false). Use this macro in mdlInitializeSizes
to set the size of a data type you have registered.
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(SimStruct *S, "Color"); if(id == INVALID_DTYPE_ID) return; status = ssSetDataTypeSize(S, id, 4); if(status == 0) return;
Languages
See Also
ssRegisterDataType, ssGetDataTypeSize
![]() | ssSetCallSystemOutput | ssSetDataTypeZero | ![]() |