11-16-2012 05:58 PM
Hello guys,
I am facing a basic problem in using subVI. In the subVI, I let the LED lights switch to flash periodically. Then I would like to use this subVI in other VI, but no output in the main VI. I highlighted the process and found out the data flow stuck at the subVI. I think it is because the data flow can go through the subVI only after it finished, since the while loop inside the subVI does not stop, the subVI could not finished. Is there any solution about this problem? Thanks a lot!
11-16-2012 07:18 PM
The subVI probably should not have a continuously running subVI.
One option is to use a queue or notifier to send the data to the main VI. But I still question your architecture.
11-17-2012 07:57 PM
so, you mean, in my case, I should not use subVI?, use the code in the main VI directly?
11-17-2012 09:07 PM
11-17-2012 09:13 PM
I see. But what about I need to repeat this loop several times? I have to repeatly use the loop in the main VI?
11-17-2012 09:38 PM
@phyyu wrote:
I see. But what about I need to repeat this loop several times? I have to repeatly use the loop in the main VI?
Yes. By definition that is what a loop does. To repeatedly use it.
11-17-2012 09:45 PM
well, I don't think it is a good idea to use a several same function loops in another big loops...
11-17-2012 10:47 PM
You take the loop out of the subVI. Put the loop in the main VI. This is what Dennis was telling you.
11-17-2012 10:51 PM
thanks guys, I will try.