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.

ssRegisterTypeFromNamedObject

Register a custom data type from a Simulink.AliasType, Simulink.NumericType, or Simulink.Bus object.

Syntax

void ssRegisterTypeFromNamedObject(SimStruct *S, char *name, int* id)

Arguments

S

SimStruct representing an S-Function block.

name

Name of the Simulink® object to assign to the custom data type.

id

An integer whose value is the numeric data type identifier after the call to ssRegisterTypeFromNamedObject.

Description

Use in mdlInitializeSizes, to register a custom data type from a Simulink.AliasType, Simulink.NumericType, or Simulink.Bus object named name.

If the registration was successful, you can declare S-function parameters, DWork vectors, or input and output ports to be of this data type, using the corresponding numeric data type identifier id. If the registration was not successful, id is set to INVALID_DTYPE_ID.

    Note   You may not register a custom data type from a Simulink.NumericType object with unspecified scaling.

Languages

C, C++

Example

The following example registers a custom data type from the Simulink.Numeric type named mydouble. It then specifies that a DWork vector and the first output port be of this data type.

int dtype;
char *name = "mydouble";
ssRegisterTypeFromNamedObject(S, name, &dtype);
ssSetDWorkDataType(S, 0, dtype);
ssSetOutputPortDataType(S, 0, dtype);

Introduced in R2007b

Was this topic helpful?