Specify unit of input port
UnitId ssSetInputPortUnit(SimStruct *S, int_T port, UnitId id);
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 the ssRegisterUnitFromExpr
method.
The unit ID specified by id
. Returns -1
if
id
is DYNAMICALLY_TYPED
.
Use in mdlInitializeSizes
(after
ssSetNumInputPorts
) to specify the unit for each input port.
Input port index numbers start at 0 and end at the total number of input ports minus
1 (0 to total number of input ports - 1).
C, C++
UnitId id = INVALID_UNIT_ID; ssRegisterUnitFromExpr(S , "m/s" , &id); if (id == INVALID_UNIT_ID) return; ssSetInputPortUnit(S, portIdx, id); ssSetOutputPortUnit(S, portIdx, id);
mdlInitializeSizes
, ssGetNumInputPorts
, ssRegisterUnitFromExpr
, ssGetInputPortUnit
, ssSetOutputPortUnit
, ssGetOutputPortUnit