From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-18-2011 12:13 AM - edited 09-18-2011 12:17 AM
Hi,
would anyone know why my control model simulation is so slow? I put an indicator of the current iteration of the control modelling loop and it takes a very long time to iterate. I've attached my simulation to this post.
Thanks
09-19-2011 09:25 AM
You have a Simulation Loop inside a while loop where you run the simulation for 10 s before getting the results in the graph. Since you place the Graph out side the loop, you will only see the output of the whole simulation (the 10 s) which takes sometime.
It looks like you want to see and interact with your simulation every timestep and, in this case, your code in incorrect. The simulation loop is all that you need to 'loop' and interact every timestep. To do that, you can change the final timestep to be "inf" and use the function "Utility >> Halt Simulation" to define when you want to stop. Also, you would need to use 'SimTime Waveform" to see the graphs as it runs.
Also, notice that the functions "CD Draw Transfer Function Equation.vi" can consume sometime if you run those in a loop. In general, if you don't want to update every timestep, you should just run once or run in a slower timerate, like every 2 s.
05-04-2018 10:53 AM
Hi, i made an PID controller in simulation loop, the time simulation is 30s, first i read the mesurement from a text file, then i calculate the error, after that i use the PID controller. the results are as expected but the simulation time runs to slow.( every text file contains 30000 value (one value for every 1 ms))
05-07-2018 09:56 AM
Hey Omar,
This post is back from 2011, please make a new Service Request for increased visibility.
A few things that would be slowing down your code:
Bdog
05-08-2018 10:41 AM
you are right the file mesurement slowed down the loop thanks a lot