LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subvi while loop

hi,

 

 can u clear my doubt with this attachment vi.... i read the message (2,3,5)... sorry for saying i 'm not able to understand to it... dont mistake me... if u its possible clear my doubt im waiting for the answer.... Smiley Indifferent

Regards,
N. Srinivasan
Download All
0 Kudos
Message 11 of 20
(3,100 Views)

Hi srinivasa,

 

if you want to present an UI to the user you should show the front panel of the subvi...

(Next time check the window appearance settings of the vi properties.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 20
(3,095 Views)

im trying for my answer.... i need from u ....

 

Smiley Sad

Regards,
N. Srinivasan
0 Kudos
Message 13 of 20
(3,084 Views)

hi gerdz,

  

  thanks a lot for post.... but i dont want to show front panel of the subvi... the data should select only from the main vi only.... the user should select the data or choose the data from the main vi... pls man...give some other idea... 

 

im begineer of labview... i though subvi will  helpful for my project that why i am lot of doubts and confusion....

 

Regards,
N. Srinivasan
0 Kudos
Message 14 of 20
(3,081 Views)

hi,

 

 

 The graph indicator in the main vi should update as soon as i select the signal from the enum control.... i think u'll understand my question and my doubts..???:mansad:Smiley Indifferent

Regards,
N. Srinivasan
0 Kudos
Message 15 of 20
(3,080 Views)

Hi srinivasan,

 

well, it's not really clear what you want to achieve...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 16 of 20
(3,077 Views)

hi,

 

  i dont want to open  the front panel of the subvi....

i create the sub vi (3 terminal) which has two input(no_of_pins- it'll initiates the For loop and  then Enumerator to  select the signal to be display)  and one output is Graph( it'll display according by the signal was selected)..

 

 

 My request is pls run only subvi and give no of pin as more than 1 and select the enum for signal... u'll find the waveform in the graph....

 

 

And now my question is:

 

now i create new VI as name as MAIN_Prg.vi should have two control (ie one for the FOR loop and another one is Enumerator for the Signal) and only one indicator  as Graph to show the waveform....

 

the problem after im selecting the signal from the enumerator  the signal waveform is updatin in the subvi and the graph indicator is empty.....

 

i think my question is clear for u....

 

i begineer for the labview.... pls help me to finish this task.... 

 

    

Regards,
N. Srinivasan
Download All
0 Kudos
Message 17 of 20
(3,070 Views)

Hi srinivasan,

 

you have to think dataflow...

 

In the main.vi you select number of signals and kind of signal (enum). Those two values are wired to the sub.vi. The sub.vi receives those values and starts it's while loop. But as you don't want to show that sub.vi the user can't change the enum on the sub.vis frontpanel and so will the while loop run forever...

 

Solution (as said before):

- don't use loops in the subvi

or:

- show the frontpanel of the subvi

 

I haven't mentioned before:

- use references of main.vi frontpanel items to get their values in the subvi - but that is overkill in my opinion whit your simple vi

 

 

More problems:

You generate more than one signal when #pins is bigger than one. But you receive only one signal in the graph - the last one. Is this intentional?

The user can select a signal, but to leave the loop one has to choose "no signal". The the graph gets cleared too and information on the choosen signal is lost...

Message Edited by GerdW on 10-16-2009 01:35 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 18 of 20
(3,066 Views)

altenbach wrote:

You should probably start with a few simple tutorials and familiarize yorself with the concept of dataflow.

 

The subVI will only output data to the main VI once the subVI has finished executing. So, once you stop the subvi, the data will go to the main VI.

 


Bo2008 wrote: 

 Some suggested a delay in the while loop, which I tried but doesn't make a difference.


 

 Who is "some"??? Never listen to "some". 😄 A delay will make a big difference in CPU use, but won't change the outcome. Any UI loop should have a small wait, it makes absolutely no sense to use 100% of the CPU to poll the controls every nanosecond. How fast can you possibly click? 😮


 

Never Listen to some. Always listen to Altenbach though. Now thats what I call good programming practice 🙂
0 Kudos
Message 19 of 20
(3,055 Views)

Smiley Happyi got the answer... here i attached my file.... i use Control refnum.. in the main_prg.vi and subvi. 🙂

 

 

because i want to learn more in labview ... i was post my question in 2 threads.. im sorry for that... after two days i was completed my first module... thank you u guide and then if i have further i'l contact u later...

 Smiley Happy

 

 

Regards,
N. Srinivasan
Download All
0 Kudos
Message 20 of 20
(3,031 Views)