Updating a Stimulus Profile to Use a Text File for Model Parameters
- Updated2025-10-27
- 4 minute(s) read
Updating a Stimulus Profile to Use a Text File for Model Parameters
Configure an existing stimulus profile to use a text file to update model parameters without having to create and run multiple profiles.
- In the VeriStand Editor, click .
- Click , navigate to <Common Data>\VeriStand Projects\Engine Demo\Stimulus Profiles\Engine Demo Return Value, and double-click the Engine Demo Return Value stimulus profile.
- Save the stimulus profile as Update Model Parameters tutorial in the <Common Data>\VeriStand Projects\Engine Demo\Stimulus Profiles\Update Model Parameters directory.
- Optional:
If you want to run the stimulus profile in the VeriStand Editor,
update the Setup step.
- Right-click Open VeriStand Workspace and select Delete.
- In the Steps palette, expand Other and drag Command Shell into the Setup.
-
In the Property Browser, specify the full path to
VeriStand.exe as the Filename.
Note You can add arguments in the Property Browser for this step to specify the VeriStand project, system definition file, and VeriStand gateway IP address to connect to.
- In the Steps palette, expand and drag Update Model Parameters from File into Main, above the Real-Time Sequence Call.
-
In the Property Browser, set Source to
<Common
Data>\VeriStand Projects\Engine Demo\Stimulus Profiles\Update Model
Parameters\OriginalParameterValues.txt
If you open this file in a text editor, you can see that it resets the three key parameters for testing purposes back to their initial values.
a [-7/9 0.5; -2/3 0] {environment temperature (C)} 25 {idle speed (RPM)} 900In this code, a is the A matrix for the engine state-space model, {environment temperature (C)} is the temperature of the environment in which the engine operates, and {idle speed (RPM)} is the RPM the engine maintains while idle.Note VeriStand expects parameter names to start with a letter and contain only alphanumeric characters or underscores. If a parameter name does not fit this convention, you can enclose it in curly braces ( { } ) to indicate that the string is a model parameter. - Select the Prompt Operator step that appears after the Real-Time Sequence Call and change the Message to Model parameters set to default values and the Dialog Title to New Parameter Values.
-
Add a second Update Model Parameters from File after the Prompt Operator, and set the
Source to <Common
Data>\VeriStand Projects\Engine Demo\Stimulus Profiles\Update Model
Parameters\ParameterUpdate1.txt.
This file changes the environment temperature and the idle speed of the engine to very high values:
{environment temperature (C)} 75 {idle speed (RPM)} 2000 - Right-click the Prompt Operator you configured and select Copy.
- Right-click Main, and select Paste to add another operator prompt to the end of section. Update its message to Environment temperature set to 75 and Idle RPM set to 2000.
-
Copy the Real-Time Sequence Call and paste it after the prompt.
Because you are running the same test on each update of the model, you do not need to configure the sequence.
-
Add a third Update Model Parameters from File after the Prompt Operator, and set the
Source to <Common
Data>\VeriStand Projects\Engine Demo\Stimulus Profiles\Update Model
Parameters\ParameterUpdate2.txt.
This file demonstrates some more advanced operations:
tempConversionFactor 0.5 {environment temperature (C)} 50 * tempConversionFactor subscript subfile.txtThe first line declares a temporary variable, tempConversionFactor. The second line uses this variable in a calculation. Temporary variables are local to the file in which you create them.
The third line uses the subscript command to call another text file subfile.txt. This subscript sets a few more parameter values. When you call a file as a subscript, VeriStand inserts the contents of the subscript file into the calling file at the line that contains the subscript call.
- Create another Prompt Operator with the Message Environment temperature reset to 25 C and the 'a' matrix (which controls RPM adjustments) changed to model a different engine.
- Copy and paste another call to the real-time sequence.
- Optional: If you want to ensure you leave your system in a known state, add another Update Model Parameters from File that calls OriginalParameterValues.txt.
- Click Update Model Parameters tutorial.nivsstimprof and in the Property Browser disable Stop Execution on Fail.
- Save the stimulus profile.
The stimulus profile code will look like the following image.

Related Information
- VeriStand Directories and Aliases
VeriStand uses directories and aliases for project files, models, and custom devices.
- Communicating with the VeriStand Editor Using Stimulus Profile Arguments
Send commands to the VeriStand Editor through a stimulus profile to specify a VeriStand project, a system definition, VeriStand Gateway IP address, or connect to a target from the system definition.
- Running a Stimulus Profile
Compile and run the stimulus profile to see the real-time sequence interact with the Engine Demo.
