Writing S-Functions    
mdlSetOutputPortSampleTime

Set the sample time of an output port that inherits its sample time from the port to which it is connected.

Syntax

Arguments

S
   SimStruct representing an S-Function block.

port
   Index of a port.

sampleTime
   Inherited sample time for port.

offsetTime
   Inherited offset time for 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 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 forward; however, if sources feeding this block have inherited sample times, Simulink might 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

C

See Also

ssSetOutputPortSampleTime, ssSetErrorStatus, ssSetInputPortSampleTime, ssSetOutputPortSampleTime, mdlSetInputPortSampleTime


  mdlSetOutputPortDimensionInfo mdlSetOutputPortWidth