Writing S-Functions | ![]() ![]() |
Get pointers to an input port's signal elements.
Syntax
Arguments
S
SimStruct representing an S-Function block.
Description
Returns a pointer to an array of signal element pointers for the specified input port. For example, if the input port width is 5, this function returns a pointer to a 5-element pointer array. Each element in the pointer array points to the specific element of the input signal.
You must use ssGetInputPortRealSignalPtrs
to get pointers to signals of type double
(real_T
).
Languages
Example
Assume that the input port data types are int8_T
.
int_T nInputPorts = ssGetNumInputPorts(S); for (i = 0; i < nInputPorts; i++) { InputPtrsType u = ssGetInputPortSignalPtrs(S,i); InputInt8PtrsType uInt8 = (InputInt8PtrsType)u; int_T nu = ssGetInputPortWidth(S,i); for (j = 0; j < nu; j++) { /* u[j] is an int8_T pointer that points to the j-th element of the input signal. */ UseInputInSomeFunction(*u[j]); }
See Also
ssGetInputPortRealSignalPtrs
![]() | ssGetInputPortSignalAddress | ssGetInputPortWidth | ![]() |