VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

stimilus profile, CSV import to modify parameter during simulation

Hello,

 

I need to do the following :

- import a CSV file in the stimulus profile edtior

- Assign some of the variables to channels which are model parameters. These must be modified / updated during simulation.

- The channels are typically "starter, accelerator pedal". These are "parameters" of the models, not "in ports".

 

I'm having this situation because of the way the simulink model is compiled. There are no / few "in ports" but mostly "parameters" which can be modified.


It works fine with the workspace, the "car" can be started and controlled through the usual veristand workspace GUI.

But the stimulus profile editor fails to modify these "parameters". I've tried the demos, I could see how the inports can be modified but when I try to do the same with parameters, the "parameters" channels are not modified as expected by the CSV from stimulus editor.

 

 

Anybody have faced similar problems ?

Is it a bug/limitation in Veristand stimulus profiled editor ? Only inports can be updated during simulation (parameters of model cannot be updated during sim ?)

 

I've tried Veristand 2011 and 2012, with the same results.

Message 1 of 4
(6,169 Views)

This is a limitation of how VeriStand treats parameters. VeriStand is designed to optimize setting parameters around the use-case of setting it from the host, not from the control loop directly.

 

Do you have control over the model? In some circumstances you can replace Constant blocks with VeriStand IO blocks to switch the parameters to inports.

 

If that is not an option, you have a few options to consider:

 

1. In VeriStand 2012 there is a Stimulus Profile step to apply a set of model parameters. This is not a replay-type step. You only apply one value per parameter in the file, rather than playing back a waveform of some sort.

2. You can use LabVIEW (or Python, C#, TestStand, etc.) and the VeriStand execution API to read a CSV file and call SetParameterValues in a loop to send values down to the target. Note, however, that this replay will not be deterministic, because you can't really control the timing of setting parameters very exactly. This would mimic what you are doing from the Workspace.

3. Similar to #2, you can record a Workspace Macro of the parameter manipulation you do in the Workspace and then play that back. Again, this won't have deterministic execution, but maybe it's good enough.

Jarrod S.
National Instruments
0 Kudos
Message 2 of 4
(6,152 Views)

Jarod,

 

ok, good to know that it's a limitation in Veristand.

I would have 2 suggestions to the product dev team : 

1. in the stimulus profile editor, don't allow user to choose a "parameter" channel. 

2. clarify this in the help, I could not find relevant info on this model parameter + stimulus profile editor issue.

 

>>>Do you have control over the model? In some circumstances you can replace Constant blocks with VeriStand IO blocks to switch the parameters to inports.

 

I know, but there are way too many of them and it also implies to do a re-map in the system definition, in the workspace.... overall the amount of work needed (and risks in breaking this complex setup) makes this not practical.

 

So I will see how to proceed now....  as you mention maybe the veristand execution API is the way to go.

 

thanks a lot for the help.

 

 

0 Kudos
Message 3 of 4
(6,142 Views)

So, correct me if I'm wrong, but my understanding is that there is no "easy" or deterministic way to edit parameters during execution of the sdf?  My situation isn't as complex and could probably just use a VeriStand IO block but I'd rather not have to do that with every model I have.

 

In its simplest form, I just want to be able to change a parameter manually via the workspace to use as an override in the model.  What would be the best way to do that without going into the model?  Are my options the same as already listed? 

0 Kudos
Message 4 of 4
(5,838 Views)