02-05-2016 12:05 AM
hi,
i'm doing animation of grinding process in labview and am making animation only by plotting series of xy graphs for each iterations of a while loop,for doing this i want each itteration of while loop to run for specific period of time. how to do that?
02-05-2016 12:16 AM
02-05-2016 12:19 AM
actually i want the component to rotate with some angular velocity,i have a array of angular velocities whether this will help to give delay...please reply
02-05-2016 12:25 AM
Show your VI (not a picture, but a snippet or attach the file itself) and explain what exactly is your goal here. So people can give more specific help...
02-05-2016 12:25 AM
02-05-2016 10:03 AM
first use elapsed time vi with appropriate accuracy to find out how much your code make delay in every loop then you can have good view of what you should do for time of iterations
02-05-2016 10:22 AM
Why would you need to use Elapsed Time Express VI? He doesn't want to know how much time has passed. He wants to have the loop iteration take a certain amount of time. The Wait function does that.
02-05-2016 11:40 AM
I believe Hatef was suggesting to find the elapsed time of the loop without any waits. So if the code takes 40ms to run, and he wants it to update at 100ms, he could put a 60ms wait in the loop. If that is true, I would just use the "Wait until next" VI instead of "Wait".
02-05-2016 12:11 PM
Indeed what I want to say ,is that we should care about elapsed time for any iteration before use wait
suppose answer is 120 ms elapsed time so dose 40 ms wait make sense? when your code make 120ms wait itself
02-05-2016 12:26 PM
Why would you need to do that?
The wait would run in parallel to all other code. Let's say you want a 100 msec loop iteration. Put in a 100 msec wait. If your code runs in parallel and only takes 20 msec, the loop iteration still only takes 100 msec because it is waiting for the wait function to finish. The first 20 msec of wait happens in parallel to the actual code, the remaing 80 msec of wait happens with nothing else executing. If the code takes 95 msec to run, and the wait is 100 msec, then the loop will still only take 100 msec. The first 95 msec of wait happens in parallel to the actual code, the remaing 5 msec of wait happens with nothing else executing
If your actual code takes 150 msec to run, the loop iteration will extend to 150 msec. The wait function will return after 100 msec, but the actual code has only completed 100 msec of work and the loop won't iterate until the execution of the remain 50 msec of code happens.