addGlobalArg
Selectively add global variable from custom code to C Caller block as global argument
Since R2024b
Description
adds a variable declared as global in the custom code to a C Caller block as
a global argument. GlobalArg
= callerObj.addGlobalArg(globalVariableName
) callerObj
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 ensure that the Automatically infer global variables as
function interfaces checkbox is not selected. Alternatively, from the command
line, use set_param
function and set
CustomCodeGlobalsAsFunctionIO
to off
for the
corresponding block. For more information, see Automatically infer
global variables as function interfaces.
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2024b