10-13-2011 07:59 PM
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.
10-13-2011 11:36 PM
10-14-2011 11:17 AM
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.
10-14-2011 03:29 PM
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.
10-14-2011 03:56 PM
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.
10-14-2011 04:01 PM
Well i mean if you are computing deltaT inside your code... like this:
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.
10-14-2011 04:24 PM
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.
10-14-2011 04:28 PM
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).
10-14-2011 04:41 PM - edited 10-14-2011 04:42 PM
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.
10-14-2011 05:12 PM