LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating SubVI problem

Solved!
Go to solution

Hi,

 

 

I am a 4th year undergraduate new to Labview. I am task to create a joystick control VI for or UAV. Now, the main part of the VI is done. But when I try to use it as a subVI, I cannot read any data. On the blank page of the VI, I just create indicators and control and connect them to the subVI.

 

Can anyone enlighten me as to what went wrong?

 

 

Thanks.

 

Ting Yu

0 Kudos
Message 1 of 6
(3,196 Views)

Hi,

 

Can you repost your VI in LV 2010 version.

 

Regards,

 

Bijay

0 Kudos
Message 2 of 6
(3,192 Views)
Solution
Accepted by topic author TingYu

Hi Ting Yu,

 

Welcome to the NI Forums.

 

WhileLoop.png

 

 

If the attached VI is what you are trying to convert into a SubVI, the reason that it loses its functionality is due to the While Loop; you have to imagine that when While Loops are implemented, due to dataflow they are essentially oblivious to data operations around them. For example, your output indicator values such as Front/Back(Y) will only be passed out of the While Loop once it has finished (With respect to your Main VI/Top Level VI).

 

To make your code function appropriately, only convert the inner code of the While Loop to a SubVI, then use the Top Level VI to control its execution. I.e. You must separate the execution control and the signal manipulation in order for your code to respond normally.


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 3 of 6
(3,179 Views)

Hi Bijay

 

Thanks for helping. I hope this is correct.

 

 

Sincerely,

Ting

0 Kudos
Message 4 of 6
(3,174 Views)

Hi TingYu,

 

 

That's Correct.

 

Thanks Alex .T

 

 

Regards,

 

Bijay

0 Kudos
Message 5 of 6
(3,169 Views)

thanks., of course thats the problem.

 

 

 

0 Kudos
Message 6 of 6
(3,163 Views)