Re: While loop in subVI
Thank you, that is exactly what I was asking. I will use the Execution Highlight mode, I didn't know this mode exists Thank you again!!
Re: While loop in subVI
Hello, I hope I understood you correctly... In general, it's better to use sub VIs to organize and modularize your code. So, if you can separate part of the code into a sub VI, do it. And if your main VI is calling the sub VI in a loop, the sub VI executes every iteration of the loop. So, you do not need a loop in sub VI, normally. But it depends on what exactly you are trying to do. Use the Execution Highlight mode (the light bulb on the diagram toolbar) to see how the code gets executed, and make changes accordingly. Regards, Khalid
Re: While loop in subVI
> If the Block Diagram of the subvi there is a while loop covering all > the code, it's the same to put it in the main VI with another while > loop, or it's not necessary? > it's the same if this subVI has a while loop covering itself that if > the subvi doesn't have this while loop because the loop is in the same > VI? If I understand your question correctly, the answer is yes. A loop around code is the same as a loop around a subVI containing the same code, is the same as a subVI containing a loop containing the code, ... There will be slight performance differences, but very small. Greg McKaskle
While loop in subVI
Hello I have a doubt about using while loops in VI and subVI. I have a VI, with two loop that are executed in parallel, and stoped with the same button, by using property nodes and references. One of the while loop executes a subVI. If the Block Diagram of the subvi there is a while loop covering all the code, it's the same to put it in the main VI with another while loop, or it's not necessary? it's the same if this subVI has a while loop covering itself that if the subvi doesn't have this while loop because the loop is in the same VI? Thank you very much