addGlobalArg
R2026bClass: Simulink.CustomCode.FunctionPortSpecification
Namespace: Simulink.CustomCode
Selectively add global variable from custom code to C Caller block as global argument
Since R2024b
Description
adds a global variable defined in the custom code as a global argument to a C
Caller block. The GlobalArg = CCallerObj.addGlobalArg(globalVariableName)CCallerObj is an object of class
FunctionPortSpecification. The function also creates a
FunctionArgument object. To use this function in Simulink®, navigate to Configuration Parameters > Simulation Target > Import settings and check that the Automatically infer global variables as function
interfaces check box is not selected. Alternatively, from the command line,
use the set_param function and set
CustomCodeGlobalsAsFunctionIO to off for the
corresponding block. For more information, see Automatically infer
global variables as function interfaces.
Input Arguments
Output Arguments
Examples
Version History
Introduced in R2024b