setmodelparam_eval (MathScript RT Module Function)
- Updated2023-03-14
- 2 minute(s) read
setmodelparam_eval (MathScript RT Module Function)
Owning Class: info
Requires: Control Design and Simulation Module and MathScript RT Module
Syntax
setmodelparam_eval('parampath', 'value')
setmodelparam_eval('VIname', 'parampath', 'value')
setmodelparam_eval(aliasgroup, 'alias', 'value')
Legacy Name: set_param
Description
Evaluates an expression, in the form of a string, at run time and configures a model parameter of a Simulation function or subsystem with the result. The VI with the simulation diagram must be in memory. This function allows you to specify an expression to evaluate dynamically at run time; however, this function causes reduced performance and is not supported on RT targets. To improve performance, use the setmodelparam function instead.
The setmodelparam_eval(aliasgroup, 'alias') syntax is available only in MathScript Nodes, and you must define aliases for model parameters before you call the function with this syntax.
Inputs
| Name | Description |
|---|---|
| VIname | Specifies the filename or path on disk of the VI with model parameters you want to access. VIname is a string and can be just the filename and extension, an absolute path, or path relative to the current VI. If you call this function in the LabVIEW MathScript Window, VIname is a required input. |
| parampath | Specifies the path of the model parameter whose value you want to write. parampath is a string in the format of 'loop label (if any).top subsystem label (if any).nested subsystem label (if any).function label.parameter'. |
| aliasgroup | Specifies the label of the MathScript Node input terminal to which you wire information about aliases and their corresponding model parameters. |
| alias | Specifies the alias for the parameter you want to configure. |
| value | Specifies the expression you want LabVIEW to execute and apply to the parameter. |
Details
The following table lists the support characteristics of this function.
Causes reduced performance ( ) |
Yes |
| Supported in the LabVIEW Run-Time Engine | No |
| Supported on RT targets | No |
Examples
Use the following example in a MathScript Node within the same VI as a Control & Simulation Loop with a Sine Signal function inside. The frequency parameter of the Sine Signal function must be unwired.
str = '5/3*pi'setmodelparam_eval('Control & Simulation Loop.Sine Signal.frequency', str)
)