LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to slow down the simulation?

Solved!
Go to solution

My system block diagramMy system block diagram

 

The new plot of the output gets graphed too quickly. I want it to slow down. 

 

I tytpically would run the simulation and the loop keeps it going. I would then toggle the numeric input that is the reference value for the PID. A new output would then be plotted. But it's like BOOM, just appered on the graph. I want it to plot point-by-point at a pace that my eye can see. I change the dt(s) value. I thought increasing the PID sampling time from 0.001s to 1s would slow the plotting down. But it was the same.

0 Kudos
Message 1 of 5
(2,767 Views)

Place a wait function (e.g. Wait (ms)) inside the While loop, and outside of the simulation.

You also need to move the Stop button inside the While loop if you want to be able to stop your VI 🙂


GCentral
Message 2 of 5
(2,738 Views)

Thanks. Putting a wait(ms) in my loop like in the picture below, puts a wait time before the next graph is plotted (say if I changed the desired value for the PID to correct to). What I want is putting a delay before the next point on the graph is plotted. I tried putting the wait block inside the Simulation Loop, but that didn't work.

 

wait block diagram.pngwait front panel.png

0 Kudos
Message 3 of 5
(2,666 Views)

Hi Lord,

 

what about changing some pf those parameters (at the left side) of the C&S loop?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(2,644 Views)
Solution
Accepted by topic author MyLord

@MyLord wrote:

Thanks. Putting a wait(ms) in my loop like in the picture below, puts a wait time before the next graph is plotted (say if I changed the desired value for the PID to correct to). What I want is putting a delay before the next point on the graph is plotted. I tried putting the wait block inside the Simulation Loop, but that didn't work.


Ah, I think I understand now.

If you want the graph to update during the simulation (a single simulation, not the repeating of the simulation with what you've labelled "iterations" - the outer while loop) then your graph must be inside the loop (just like with normal LabVIEW).

 

Since you might want to keep some history, there's likely to be a little bit of fiddling to get the data stored how you want it and updated as you need it.

 

Try placing both the XY Graph and the Wait inside the Simulation loop, and leaving the XY Graph connected to the Collector output.

That might be what you want, or it might at least get you closer and allow you to explain what you want that is different to that (for example, previous simulations' results to remain on the graph as separate plots, etc).


GCentral
Message 5 of 5
(2,629 Views)