ssGetBusElementName
Get the name of a bus element
Syntax
const char* ssGetBusElementName(SimStruct* S, int_T busTypeId, int_T elemIdx)
Arguments
SSimStruct that represents an S-Function block
busTypeIDThe bus data type identifier that represents the bus signal
elemIdxThe zero-based bus element index
Returns
const char*
Description
Get the name of the bus element that you specify. Use
ssGetBusElementName for error reporting or consistency
checking.
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<numElems; i++) {
const char *elemName = ssGetBusElementName(S, dType, i);
if (strcmp(elemName, "control_signal") == 0) {
ssSetErrorStatus(S, "No bus element named control_signal found");
}
}
}
See Also
ssGetBusElementComplexSignal,
ssGetBusElementDataType,
ssGetBusElementDimensions,
ssGetBusElementNumDimensions
Version History
Introduced in R2010a