VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Parameter names in VeriStand as access via .net API

Solved!
Go to solution

General Background:
We are building an application that accesses VeriStand via the .net API (C++).
We managed the complete setup and everything is working well now,

however the question of parameter names keeps confusing us and our customers (they are using our application).

I should mention that we are not users of VeriStand, nor trained, so some of the information might be in your training material.

We have checked your help but there we did not find sufficient information to answer our questions.
I will be referring to 2010/11.

Questions:
What is the name of a parameter? How do I influence the name and the default value?
To illustrate:
Open the system explorer for the sinewave_delay demo you ship.
Navigate to the Sinewave Delay/Targets/Controller/Simulation Models/Models/.
There inspect the Parameter nodes for all 4 models.
You see duplicate names, like Order for both delay_random and delay_sineware,
or Amplitude and Bias for both random and sinewave.

When using GetParameterList() of the .net API, you get the following parameters:
    Parameter 0: delay_sinewave/z-block/Order
    Parameter 1: Amplitude
    Parameter 2: Bias
    Parameter 3: Frequency
    Parameter 4: Gain
    Parameter 5: Phase
    Parameter 6: delay_random/z-block/Order

So when I set Amplitude, do I set BOTH amplitudes? Or just one?
Where do I set the name of the parameters used in the .net API?
Can I influence it and if not, how are they built?
In the Expression window I can see a close match, but
there I find delay/z-block/Order and delay/z-block/Order,
when in the .net API the "delay" seems substituted with the model instance names.
Right? Wrong?
Currently, any parameter that has the same name has the same value.
Is that a coincidence or are we accessing the same object via a given name?
If so, which name? The one in the .net API?
How is that mapping controlled?
How can I tell, e.g. that there are two Amplitudes with two different values then?

Any help is appreciated!

Regards,

 - AJ

0 Kudos
Message 1 of 4
(5,945 Views)

Good question.

 

There are two types of parameters inside NI VeriStand. Global parameters that are shared throughout the entire system (similar to The MathWorks, Inc. MATLAB® workspace variables), or there are block parameters that are not global and only apply to that model.

 

Unfortunatley this isn't documented very well as you noticed, but there is some documentation in the comments of the model frame work C code you can find here if you install the model frame work option of the NIVS installer: "C:\VeriStand\2011\ModelInterface\custom\sinewave\sinewave.c"

 

// When a model has parameters of the form: "modelname/parameter", these model parameters are considered workspace variables in veristand
// When a model has parameters of the form: "modelname/block/paramter" these model paramters are NOT considered workspace variables in NI VeriStand
// A model should only contain either workspace variables or parameters. Never both.

 

So for the sinewave delay example the get parameter list shows parameter 1-5 are global and parameter 0 and 6 are local to that specific model.

 

Depending on what software you are using to create the models... they have different settings for how you want the parameters exposed in the model. For example, in The MathWorks, Inc. Simulink ® software when you configure the model build with The MathWorks, Inc. Real-Time Workshop ® one of the optimization options is to "inline" parameters. If you select this, then you compile in selected workspace variables as parameters. If this is unselected (default), then block variables are the parameters.

Stephen B
0 Kudos
Message 2 of 4
(5,936 Views)

Hi,

 

thanks for taking the time to respond!

 

Are you saying that the distinction between global or local is reflected in the name with or w/o path, respectively?

 

Indepent of this, what about multiple parameters with the same name (e.g. Amblitude and Bias)?

Are these the SAME parameters with a single value effecting the different components referencing it?

 

Regards,

 - AJ

0 Kudos
Message 3 of 4
(5,925 Views)
Solution
Accepted by topic author andreas.junghanns@qtronic.de

andreas.junghanns@qtronic.de wrote:

Hi,

 

thanks for taking the time to respond!

 

Are you saying that the distinction between global or local is reflected in the name with or w/o path, respectively? Yes

 

Indepent of this, what about multiple parameters with the same name (e.g. Amblitude and Bias)? If they have no block name in the path then they will all be the same.

Are these the SAME parameters with a single value effecting the different components referencing it? Parameters with no block name in the path have unique instances under each model if you look in the system definition tree... but if multiple models have the same parameter name with no block path... they will always have the same value.

 

Regards,

 - AJ


 

Stephen B
Message 4 of 4
(5,918 Views)