| Contents | Index |
Add argument configuration information for Simulink model port to model-specific C function prototype
addArgConf(obj, portName, category, argName, qualifier)
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.
| obj | Handle to a model-specific C prototype function control object previously returned by obj = RTW.ModelSpecificCPrototype or obj = RTW.getFunctionSpecification(modelName). |
| portName | String specifying the unqualified name of an inport or outport in your Simulink model. |
| category | String specifying the argument category, either 'Value' or 'Pointer'. |
| argName | String specifying a valid C identifier. |
| qualifier | String specifying the argument type qualifier: 'none', 'const', 'const *', or 'const * const'. |
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)
You can specify the argument configuration information in the Model Interface dialog box. See Configure Function Prototypes in the Embedded Coder™ documentation.
RTW.ModelSpecificCPrototype.attachToModel

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 |