LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subVI

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! 

Download All
0 Kudos
Message 1 of 9
(3,416 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 9
(3,408 Views)

so, you mean, in my case, I should not use subVI?, use the code in the main VI directly?

0 Kudos
Message 3 of 9
(3,376 Views)
No, that is not at all what was said. What was said and what I agree with is that the subVI should not have the loop. The simple solution is to have a loop in the main VI.
0 Kudos
Message 4 of 9
(3,369 Views)

I see. But what about I need to repeat this loop several times? I have to repeatly use the loop in the main VI?

0 Kudos
Message 5 of 9
(3,364 Views)

@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.

0 Kudos
Message 6 of 9
(3,355 Views)

well, I don't think it is a good idea to use a several same function loops in another big loops...

0 Kudos
Message 7 of 9
(3,349 Views)

You take the loop out of the subVI.  Put the loop in the main VI.  This is what Dennis was telling you.

0 Kudos
Message 8 of 9
(3,334 Views)

thanks guys, I will try.

0 Kudos
Message 9 of 9
(3,331 Views)