(8.D.2.3) ParamGet
Overview
Gets parameters in other modules
Discussion
The ParamGet module gets the value of a parameter from another module.
At instantiation time (or in Module Name and Arguments in Audio Weaver Designer), you specify the data type of the input pin and also the variable which will be fetched. The variable is specified as
Mod.Var
where Mod is the name of the module (in the same level of the hierarchy as the ParamGet module) and Var is the variable name. You can also specify modules that are within subsystems using
Subsystem.Mod.Var.
You can also go up in hierarchy and get parameters from modules that are in an upper system. Use a single backslash character to move up one level in the hierarchy. Use multiple backslash characters to traverse multiple levels of hierarchy. Suppose that the ParamGet module is located in:
SYS.Subsystem.ParamGet
and you want to get the variable
SYS.Scaler1.gain
Then set the Mod.Var field to
\Scaler1.gain
And finally, you can also get individual values from arrays using the syntax
Mod.Var[index]
where index is the zero-based index of the element in the array Var to get.
Please see the ParamGet example for specific use cases.
Type Definition
typedef struct _ModuleParamGet
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
void * modPtr; // Points to the module to get
void * varPtr; // Points to the variable to get within the module instance structure
} ModuleParamGetClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
modPtr | void * | parameter | 1 | Â | Unrestricted | Â |
varPtr | void * | parameter | 1 | Â | Unrestricted | Â |
Pins
Output Pins
Name: out
Description: parameter value
Data type: float
MATLAB Usage
File Name: param_get_module.m
M=param_get_module(NAME, DATATYPE, MODVAR)
Parameter get module. This module can reach into the instance structure
of other modules and gets the parameter values. Arguments:
NAME - name of the module.
DATATYPE - string specifying the data type of the variable and
also used for the data type of the input pin. Allowable
values are 'float', 'int', or 'fract32'. Implicit casts from
'int' to 'uint' variables allowed, but take caution to avoid
passing out of range values.
MODVAR - specifies the module and variable name using the form:
'MOD.VAR' where MOD is the module name and VAR is the
variable name. You can also specify internal subsystems using
'SUBSYS.MOD.VAR'.
EXECUTIONORDER - Determines when the ParamSet module executes relative
to the module it is controlling. Allowable values are:
'undefined' - the default. The execution order is set
by the routing algorithm and can occur before
or after the module it is controlling.
'before' - forces ParamSet to execute before the module it
is controlling.
'after' - forces ParamSet to execute after the module it
is controlling.
When using 'before' and 'after' you could get a build error
indicating that no more modules can execute or there is a
circular dependency.
Â