Initializing Parameter Values
- Updated2025-10-15
- 3 minute(s) read
Many models have parameters, which act as variables in the model. The default values of parameters are compiled into the model. However, you can perform the following tasks to set new initial values:
- In the appropriate modeling environment software, manually change the parameter values in the model, and then recompile the model.
- In your LabVIEW code, use the Model Interface API to programmatically change parameter values at run time. After your code loads a model, you can set an initial value for a parameter, as shown below.
In the latter case, initializing a parameter value with the Model Interface API is a two-step process: setting the new values, and then committing the new values. The following block diagram shows how to initialize a specific parameter in the initialization portion of your code:
|
Loads the model from disk and creates a model reference that you pass to other VIs throughout the application to set its parameters, and later, to run the model in a control loop. |
|
Creates a Parameter Interface reference that you pass to other VIs to get and set model parameters. |
|
Sets the value of the scalar parameter whose index is 1 among all the
model parameters. Tip
|
|
Commits the new value to the model. The Model Interface API only applies values you set after the Commit Parameters VI runs. |
After this initialization portion of your code runs, your model will use the new parameter value when the control loop of your application steps the model for the first time.
Refer to the MIT Multiple Models VI in the labview\examples\Control and Simulation\Model Interface directory for example code that demonstrates these concepts.


Updating Parameters While a Model Runs
Basic Architecture for Executing Models