ssSetOutputPortUnit
Specify unit of output port
Syntax
UnitId ssSetOutputPortUnit(SimStruct *S, int_T port, UnitId id);
Arguments
-
S
-
SimStruct representing an S-Function block.
-
port
-
Index of an input port.
-
id
-
ID of the unit accepted by
port
. This ID is returned from thessRegisterUnitFromExpr
method.
Returns
The unit ID specified byid
. Returns-1
ifid
isDYNAMICALLY_TYPED
.
Description
Use inmdlInitializeSizes
(afterssSetNumOutputPorts
) to specify the unit for each output port. Output port index numbers start at 0 and end at the total number of output ports minus 1 (0 to total number of input ports - 1).
Languages
C, C++
Example
UnitId id = INVALID_UNIT_ID; ssRegisterUnitFromExpr(S , "m/s" , &id); if (id == INVALID_UNIT_ID) return; ssSetInputPortUnit(S, portIdx, id); ssSetOutputPortUnit(S, portIdx, id);
See Also
mdlInitializeSizes
,ssSetNumInputPorts
,ssRegisterUnitFromExpr
,ssSetInputPortUnit
,ssGetInputPortUnit
,ssGetOutputPortUnit