Documentation Home Page ◇ RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.
Load/Save Configuration Documentation | RT-LAB 11.3.x and up
About the Load/Save Configuration Tool
RT-LAB contains various features that provide flexibility and versatility while testing. One of these is the Load/Save Configuration tool, which allows you to test various combinations of parameters on-the-fly without changing the underlying model.
For example, on a parameter you are testing, you may choose to build three sets of values, X, Y, and Z. You may then load them, one at a time, sequentially, and watch how your results are affected. You may then choose to save the most favorable results, or the ones that most interest you, and/or make a choice to overwrite the default values.
Using Load/Save Configuration
Locate the Current/Updating Value of a Variable
- Start RT-LAB with the rtdemo1 model
- Uncollapse the folders Models, rtdemo1, and then sm_computation in this order.
- Uncollapse one or more of the Gain folders, for example:
- You’ll note that the folder contains a parameter or variable, in this case, labeled Gain, and a signal (with a distinct icon), which is numbered.
- In this example, above, we've also opened the Gain Kd and Gain1 variables, which also contain signals.
Note: If you are not seeing parameters or signals in your hierarchical model tree, in the left margin, you may need to build your model.
- To do so, right-click, Model > Simulation > Build.
- During the building process, the model tree, along with its parameters and signals, are created.
- For the purposes of this exercise, we’re concerned with the parameter or variable, labeled Gain.
- Ensure the lower right window has the Variables Table tab open and selected, and drag and drop the Gain signal into this tab.
- Do the same with the Gain Kd and Gain1 signals.
If the Variables Table doesn't appear in your interface at this point, it can be opened through Windows > Show View > Variables Table.
- The three Gain values appear in the Variables Table.
- This is how you will view the current and dynamically changing (updating) values of this and other variables. (Note the Value column.)
- Note that only Parameters are editable. Signals are read-only.
Check Your Pre-existing Parameters/Variables
A model will have pre-defined parameters or variables.
- Right-click rtdemo1 (your model) > Edit with > MATLAB [version].
- The Opening Model dialog is displayed in the lower left, and your model opens.
- Double click the sm_computation block in MATLAB Simulink, and then, for example, double-click the Gain icon.
- The Block Parameters: Gain dialog appears. This is the current value of the Gain parameter, in this case, 1.
- Note the dialog also has Signal Attributes and Parameter Attributes tabs.
Note: The original Gain value from the left tree-view folder signal corresponds to the Gain value in the MATLAB model.
Every time the model is reset, the value resets to its model default value.
Edit Values/Parameters in the Variables Table Viewer
- Double-clicking the Gain entry in the Variables Table shows the Gain value in the Variable Viewer.
- You can also click in the value text box of Parameters to change the value.
NOTE:
Each time you want to use the SAVED configuration file, load it before using to ensure the desired parameters are used.
One result of the model's compilation is the file <my_model>.param appears, located in <my_project>/models/<my_model>/Opcommon
When you save a new configuration, the configuration is stored in the Configurations folder.
Note also that to check any parameters, users may want to edit their configuration file at this path: Configurations/[MyConfigurationName]/Parameters/Current.param
- Knowing where the variables are pulled from, how they propagate the simulation, and where they are displayed, we are now ready to set up alternate parameter sets.
In a typical use case, you may have three parameter sets you are testing, where one ends up to be too much, one too little, and the third just right.
To change a parameter, select it, then click its Value in the lower-right window > Variables Table, and edit it manually.
In the upper-right window, click the rtdemo1 tab > the Simulation Tools tab, then note the Configuration > Save and load parameters in Configuration checkbox at the bottom of this tab.
- When this box is checked, multiple configurations and thus multiple .param files are allowed.
Right-click the Configuration folder in the left margin, and you have a choice of:
Save, Load or Delete Configurations
Save configuration as… | Saves the current configuration under a different name. You may wish to change a few variables in the current configuration to do some tweaking, then save it under a meaningful name. |
---|---|
Save configuration | Saves the current configuration. |
Load configuration | Loads a previously set up configuration. |
Delete configuration | Delete this configuration. |
Properties | Displays the properties of the selected configuration. |
- In this case, we’ll Save configuration as…
Note: You must reset your model (CTRL + Alt + R) before saving a configuration file.
- A dialog appears, called Parameters in configuration. Do you wish to save parameters?
This gives you the option to:
Yes, from reset values | Saves parameters from their last values before a reset. |
---|---|
Yes, from active values | Saves the current parameters active in the model. Note: that after reset, values are reset to the model's initial values; choosing this option resets them. This option is more meaningful while updating offline models. |
No | Does not save parameters. |
Cancel | No action is performed and the dialog is closed. |
Continue Building Variable Sets & Configuration Files
- If you are interested in building a suite of parameters sets, click Yes, from active values.
- A naming dialog appears where you are asked to enter a Name for the configuration.
- Enter a name that is meaningful to you (i.e., Gain_testing_value) and click OK.
- If you are testing several values, i.e., 6, 8, 10, 12, you may want to include these in the configuration name, so that you can tell from the name along which signal value is being tested.
- Load and Execute your model, and the current configuration is used.
- Continue Saving configurations as…, using your suite of selected values, and continuing to edit them manually in the Variables Table, until you have populated the RT-LAB interface with the values/parameters you’d like to test.
- Note that you may need to Reset, Load, or Execute between setting up and loading configuration files, as indicated by the on-screen prompts and/or error dialogs.
- When you select Load Configuration from the Configuration > Right-click menu, the Load dialog appears, asking you to select either the Default configuration or one you have set up as an alternative.
OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter