05-24-2016 04:36 PM
hi everyone,
I have some optimization problem
it output piot and waves on XYgraph
when i start my program (choose N1 in project in run-menu)
each next loop take more time than previous,specially if use "follow point" function whis nonzeros arguments dx,dy,t (t is number of iteration and it must be nonzero )
I think that main problem in "circle.vi" function because it recursion function. I tried swap while loop in that function by "drow circle by radius" but it doesnt work with XYgraph.
Can you give some ideas whou i can optimize it?
and some exaples if it posible because i am beginer in labview and programing
thank you
Solved! Go to Solution.
05-24-2016 05:45 PM
05-25-2016 12:17 AM
1)Here is a new version.
2)Not so often i think, size of this arrey =t or t+1.
3)I dont need very large circle wich bigger than XYgraph size. Maby i can do something with them.
4)O, i see it thank you. But when i moved it in another place it stoped work. i add "Untitled 1.vi" which hasnt plot color changing function.
(LAb1.zip has "Untitled 1.vi" which include that function and that "Untitled 1.vi" does not work )
5)fixed
6)i tried fix it but nothing worked.
7)i have Lenovo S205 with 1GB ram and 1.65 GH proc. Is it not enough?
thank you for answers
05-25-2016 09:59 AM - edited 05-25-2016 12:40 PM
So what is the program actually supposed to do? Just dynamically draw a few circles of various sizes? That seems trivial and should not consume any significant computer resources, so something is wrong.
Why does "point.vi" draw two identical points instead of just one?
Again, your VI runs out of control spinning nearly empty loops as fast as the computer allows whenever nothing needs to be done. You need wait statements! You need to rearchitect the code to keep the UI unclogged. Currently, selecting any of the menu entries is an irreversible trap that cannot be escaped. Don't dig yourself into a deep hole with stacks and stacks of while loops. Most likely all you need is a single one!
At this stage, focus on the algorithm and avoid all this UI micromanagement with menus, visibility and other properties. That should be the last step before release and is currently only in the way.
Please explain in a few words what the user does and what is supposed to happen in response. I am sure it could be done with 10% of the current code! 😄
05-25-2016 12:22 PM
it will be my project about Doppler effect
now i want to take the same animation like here
i fixed "traps" (i think so) "point.vi" , "circle.vi"(name was chenged to "circle11.vi" and it has less code), removed 1 loop but lost opportynity to continue working after ploting
Unfortunately my mark depends on "menus, visibility and other properties"
Thank you for answer
05-25-2016 01:30 PM - edited 05-25-2016 01:33 PM
@mbsto wrote:now i want to take the same animation like here
Why so complicated! Here's a solution that does this animation with much less code. To create a circle, create a unit circle once using a ramp to 2pi and complex math and append a NaN to create a gap (=no line!) when appending successive circles to the same plot. For each circle, apply scale and offset as needed.
See if this make sense to you. I am sure you can adapt some of it to your needs. Good luck!