Main Content

ssGetBusElementDataType

Get the data type identifier for a bus element

Syntax

int_T ssGetBusElementDataType(SimStruct* S, int_T busTypeID, int_T elemIdx)

Arguments

S

SimStruct that represents anS-Functionblock

busTypeID

The bus data type identifier that represents the bus signal

elemIdx

The zero-based bus element index

Returns

int_T

Description

使用特定的数据类型标识符bus element in a bus signal. Use the data type identifier to determine useful aspects of the bus element, including the number of elements (if this bus element is itself a bus signal) or the size of the data (ssGetDataTypeSize).

Languages

C, C++

Examples

static void mdlOutputs(SimStruct *S, int_T tid) { DTypeId dType = ssGetOutputPortDataType(S, 0); const void *u = ssGetInputPortSignal(S, 0); int numElems = ssGetNumBusElements(S, dType); int i; for(i=0; i
             

Version History

Introduced in R2010a