Writing S-Functions | ![]() ![]() |
Get pointers to signals of type double
connected to an input port.
Syntax
InputRealPtrsType ssGetInputPortRealSignalPtrs(SimStruct *S, int_T port)
Arguments
S
SimStruct representing an S-function block.
Description
Returns pointers to the elements of a signal of type double
connected to port
. The input port index starts at 0 and ends at the number of input ports minus 1. This macro returns a pointer to an array of pointers to the real_T
input signal elements. The length of the array of pointers is equal to the width of the input port.
Languages
Example
The following example read all input port signals.
int_T i,j;
int_T nInputPorts = ssGetNumInputPorts(S);
for (i = 0; i < nInputPorts; i++) {
InputRealPtrsType uPtrs =
ssGetInputPortRealSignal(S,i);
int_T nu = ssGetInputPortWidth(S,i);
for (j = 0; j < nu; j++) {
SomeFunctionToUseInputSignalElement
(*uPtrs
[j]);
}
}
See Also
ssGetInputPortWidth, ssGetInputPortDataType, ssGetInputPortSignalPtrs
![]() | ssGetInputPortRealSignal | ssGetInputPortRequiredContiguous | ![]() |