Writing S-Functions | ![]() ![]() |
Set the sample time of an output port that inherits its sample time from the port to which it is connected.
Syntax
void mdlSetOutputPortSampleTime(SimStruct *S, int_T port, real_T sampleTime, real_T offsetTime)
Arguments
S
Simstruct representing an S-function block.
port
offsetTime
port
Description
Simulink calls this method with the sample time that port
inherits from the port to which it is connected. If the inherited sample time is acceptable, this method should set the sample time of port to the inherited sample time, using ssSetOutputPortSampleTime
. If the inherited sample time is unacceptable, this method should generate an error generated via ssSetErrorStatus
. Note that this method can set the sample time of any other input or output port whose sample time derives from the sample time of port, using ssSetInputPortSampleTime
or ssSetOutputPortSampleTime
.
Normally, sample times are propagated forwards, however if sources feeding this block have an inherited sample time, Simulink may choose to back propagate known sample times to this block. When back propagating sample times, we call this method in succession for all inherited output port signals.
See mdlSetInputPortSampleTime
for more information about when this method is called.
Languages
See Also
ssSetOutputPortSampleTime, ssSetErrorStatus, ssSetInputPortSampleTime, ssSetOutputPortSampleTime, mdlSetInputPortSampleTime
![]() | mdlSetOutputPortDimensionInfo | mdlSetOutputPortWidth | ![]() |