VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Models>>ModelName>>Signals

What are the "Signals" under Models>>ModelName in the VS System Explorer?  I am writing a simple model but fail to see any parameters under Signals. In the Sinewave example there are some "Signals"...

 

Also the basic model I wrote does not show the Model Time increments on the VS Workspace GUI. Any idea why?

 

thx.

L.

0 Kudos
Message 1 of 10
(6,690 Views)
Signals are internal values of the model. Almost like probing a value in labview. Using a labview model doesn't make any signals... So you won't ever see any from a labview model. You just get Outputs (which are pretty much the same anyway). Some modeling environments like Simulink have lots of rules and terminology for what a "signal" is in a model, which would show up there.

Model time will only increment for models that have an internal solver. If you just use a LV model you will see the model rate is listed as "Inf" and model time never changes because there is no concept of time inside the model as It doesn't use a solver. This is in contrast to using a LV model that was compiled from a LV Control Design and Simulation subsystem... Which has settings for step size and solver and therefore would have a time and rate. Same goes for other modeling environments.
Stephen B
0 Kudos
Message 2 of 10
(6,686 Views)

Thx Stephen.

 

So in this case, how to pass to my LV model the time step beside using  a user variable? So for instance if my PCL is 1000Hz and Model decimation loop rate is 1, my model rate is presumably 1000 Hz --> 1ms. I can pass this via a user variable where I would have to also specify either the decimation (and read the rate from the system variable), or specify the rate. In this case, the same information would have to be specified twice...

 

Is there a way to get the actualy rate without relying on multiple user inputs? 

 

L.

0 Kudos
Message 3 of 10
(6,672 Views)

If you're not using a solver in your model, there is no way to get that information from the model time channel. If you are using labview, just copy and paste your code into a simulation subsystem (with CD/SIM installed go file -> new and then pick simulation sub system) and set the step size when you compile... the model time channel will have the information you desire.

Stephen B
0 Kudos
Message 4 of 10
(6,663 Views)

Really?!? The test model I have is very simple:

 

Voltage (i+1) = Voltage(i)+a*Current(i)*delta_t

 

"a", being a constant. So this is basic in LabVIEW. Running a RT loop, I could get the actual iteration time back in the algorithm

If we assume delta is constant, one could hardcode it, but I think it is generally a bad idea.

So you are saying there is no way I can get the iteration rate back into my model execution as if delta_t was a parameters?

 

Thx

L.

0 Kudos
Message 5 of 10
(6,660 Views)

Well i mean if you are computing deltaT inside your code... like this:

time since last call.png

 

You could simply output that as a model output. But yes, unless you compile your LV model from a sim subsystem (which is really easy to do and I encourage it), the model time channel will always be 0.

Stephen B
0 Kudos
Message 6 of 10
(6,655 Views)

Not sure what you meant here.

 

Do you mean that using a single iteration while loop, or a feedback node in the model code would work, or would not, if I just use LV and no solver?

L.

0 Kudos
Message 7 of 10
(6,650 Views)

You said your equation is using the deltaT to compute something. A*B*deltaT. How are you getting the deltaT? Normally a model would just get the simulation time steps from the solver (if you used a simulation subsystem), but if you cannot use that... you could get the deltaT by doing what I posted above (or use a single iteration while loop with a shift register instead of the feedback node).

Stephen B
0 Kudos
Message 8 of 10
(6,647 Views)

Smiley Wink haa that is what I was asking.  For now I was setting delta_t as a constant, since my PCL = 1kHz and the model loop decimation is 1. So

my model iteration time should be in 1ms as well... 

 

But since I don't know how Versitand really uses the model loop, (in a LV RT loop I'd assume) I was not sure how to deal with the delta_t if I wanted it to be dynamic. For that matter, and pointing to your code snippet, would a single-iteration while loop, or a feedback node produce the values from the previous iteration ?  In essence,  bringing in variable (i-1) back in the iteration i ?

 

L.

0 Kudos
Message 9 of 10
(6,642 Views)
Yes and yes! Should work fine.
Stephen B
Message 10 of 10
(6,636 Views)