getArgPosition

Class: RTW.ModelCPPArgsClass
Package: RTW

Get argument position for Simulink model port from model-specific C++ class interface

Syntax

position = getArgPosition(obj, portName)

Description

position = getArgPosition(obj, portName) gets the position — 1 for first, 2 for second, etc. — of the argument corresponding to a specified Simulink® model inport or outport from a specified model-specific C++ class interface.

Input Arguments

objHandle to a model-specific C++ class interface control object, such as a handle previously returned by obj = RTW.getClassInterfaceSpecification (modelName).
portNameCharacter vector specifying the name of an inport or outport in your Simulink model.

Output Arguments

positionInteger specifying the argument position — 1 for first, 2 for second, etc. — for the specified Simulink model port. Without an argument for the specified port, the function returns 0.

Alternatives

To view argument positions in the Simulink Configuration Parameters graphical user interface, go to the Interface pane and click the Configure C++ Class Interface button. This button launches the Configure C++ class interface dialog box, where you can display and configure the step method for your model class. In the I/O arguments step method view of this dialog box, click the Get Default Configuration button to display step method argument positions. For more information, see Configure Step Method for Your Model Class.