Showing results for 
Search instead for 
Did you mean: 

shift register versus comparison in while loop



I have a question regarding the "proper" (i.e. cheaper in terms of system ressources, easier to read, etc)  way of testing the first entry in while loop. One way would be by using a shift register another by detecting if the loop iteration is zero (see the exemples attached here).   I am doing some calculations in this loop, typically 300 iterations or so.

Which way is better ? Are there other (simpler) waysofdoing this ?





Download All
0 Kudos
Message 1 of 5
In terms of efficiency, speed, and system resources, I'd expect any difference to be unnoticeable.  Personally I like the =0 iteration terminal approach.
Message 2 of 5

I agree with nathand.

One tip: If you really need speed avoid using express vis.

Message 3 of 5

thanks for the answers

concerning the express vi : for me the time_elapsed seems unavoidable !



0 Kudos
Message 4 of 5
Express vi's are not entirely evil. And the time delay express vi's are harmless. I have found express vi's to be very useful if I'm trying something new. Besides, once you get everything working the way you want it to you can always open the front panel and clean out any extraneous code that might slow things down. Once you have done that it will perform just like you wrote it yourself.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 5 of 5