Skip to Main Content Skip to Search
Product Documentation

addArgConf - Class: RTW.ModelSpecificCPrototype
Package: RTW

Add argument configuration information for Simulink model port to model-specific C function prototype

Syntax

addArgConf(obj, portName, category, argName, qualifier)

Description

addArgConf(obj, portName, category, argName, qualifier) method adds argument configuration information for a port in your ERT-based Simulink® model to a model-specific C function prototype. You specify the name of the model port, the argument category ('Value' or 'Pointer'), the argument name, and the argument type qualifier (for example, 'const').

The order of addArgConf calls determines the argument position for the port in the function prototype, unless you change the order by other means, such as the RTW.ModelSpecificCPrototype.setArgPosition method.

If a port has an existing argument configuration, subsequent calls to addArgConf with the same port name overwrite the previous argument configuration of the port.

Input Arguments

objHandle to a model-specific C prototype function control object previously returned by obj = RTW.ModelSpecificCPrototype or obj = RTW.getFunctionSpecification(modelName).
portNameString specifying the unqualified name of an inport or outport in your Simulink model.
categoryString specifying the argument category, either 'Value' or 'Pointer'.
argNameString specifying a valid C identifier.
qualifierString specifying the argument type qualifier: 'none', 'const', 'const *', or 'const * const'.

Examples

In the following example, you use the addArgConf method to add argument configuration information for ports Input and Output in an ERT-based version of rtwdemo_counter. After executing these commands, click the Configure Model Functions button on the Interface pane of the Configuration Parameters dialog box to open the Model Interface dialog box and confirm that the addArgConf commands succeeded.

rtwdemo_counter
set_param(gcs,'SystemTargetFile','ert.tlc')

%% Create a function control object
a=RTW.ModelSpecificCPrototype

%% Add argument configuration information for Input and Output ports
addArgConf(a,'Input','Pointer','inputArg','const *')
addArgConf(a,'Output','Pointer','outputArg','none')

%% Attach the function control object to the model
attachToModel(a,gcs)

Alternatives

You can specify the argument configuration information in the Model Interface dialog box. See Configure Function Prototypes in the Embedded Coder™ documentation.

See Also

RTW.ModelSpecificCPrototype.attachToModel

How To

  


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