Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

for and while loop

hello
 

In the begening i used for loop to move axis , now i added while loop for emergency cases to stop all axis movements.The problem now is that after i have added the while the axis move verry slowly, and if i delete while everything returns to normal , it appeared that the program spends lot of time in while-loop, what can i do to reduce this time

thanks

Toni

0 Kudos
Message 1 of 4
(3,930 Views)

Hi Toni,

do you use LabVIEW? Can you upload your code? Normally i see no problem with while loops. How fast shall your loop run?

Mike

0 Kudos
Message 2 of 4
(3,924 Views)
In additiion to Mike's request, I would just like to add that with LV8.5 and higher a for loop can now be stopped. (right-click on the border of the loop >> Conditional Terminal)
But I'm almost shure that there is something wrong in your code.



0 Kudos
Message 3 of 4
(3,920 Views)
Suspect you may need a wait(ms) function in your while loop with at least 0 or 1 msec delay to prevent it from hogging CPU cycles.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 4 of 4
(3,906 Views)