Skip to Main Content Skip to Search
Product Documentation

mdlSetInputPortFrameData - Specify whether an input port accepts frame data

Required

No

C Syntax

#define MDL_SET_INPUT_PORT_FRAME_DATA
void mdlSetInputPortFrameData(SimStruct *S, int_T port,
 Frame_T frameData)

C Arguments

S

SimStruct representing an S-Function block.

port

Index of a port.

frameData

String indicating if the input port accepts frame data.

MATLAB Syntax

SetInputPortSamplingMode(s, port, mode)

MATLAB Arguments

s

Instance of Simulink.MSFcnRunTimeBlock class representing the Level-2 MATLAB S-Function block.

port

Integer value specifying the index of port whose sampling mode is to be set.

mode

Integer value specifying the sampling mode of the port (0 = sample, 1 = frame).

Description

This method is called with the candidate frame setting for an input port.

For C MEX S-functions, frameData is either FRAME_YES or FRAME_NO. If the proposed setting is acceptable, the method sets the actual frame data setting using ssSetInputPortFrameData. If the setting is unacceptable, the method generates an error via ssSetErrorStatus. Note that any other input or output ports whose frame data settings are implicitly defined by virtue of knowing the frame data setting of the given port can also have their frame data settings configured. This method is only valid for simulation, and must be enclosed in a #if defined(MATLAB_MEX_FILE) statement.

For Level-2 MATLAB S-functions, if the value of mode is acceptable, this method sets the sampling mode using the line

s.InputPort(port).SamplingMode = mode;

The Simulink engine calls this method until all input ports with inherited frame settings have their frame settings specified.

The use of frame-based signals (mode has a value of 1 or frameData has a value of FRAME_YES) requires a DSP System Toolbox license.

Languages

C, C++, MATLAB

See Also

ssSetInputPortFrameData, ssSetOutputPortFrameData, ssSetErrorStatus

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS