LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am using two while loops in labview .. i want a single stop button to stop the both things

Hi !

I am back again..

It seems that when I create a vi for the simple button controls that we discussed above,  based on your suggestions, it works standalone but not when I put it on a tab control.

When I start it the vi the button press causes the signal to go F to T but the vi seems to be waiting. for what ? The vi with tab is attached..

 

I don't understand this it at all. Isn't this the purpose of making subvi's, to be able to encapsulate the details ?

Maybe you or someone can explain to me.. This does not make any sense...

Thanks.

Bhal TUlpule

0 Kudos
Message 21 of 26
(528 Views)

You forgot to attach the subVI.

0 Kudos
Message 22 of 26
(525 Views)

Oops !

See attached.

I tried to put on the tab (1) a while loop around the vi and buttons, (2) event loop. Neither worked, in the sense that when I push the buttons I do not see any status change on the block diagram.. So no output to string. I would like to understand this..

I have done other vi's in the past and the buttons when connected thru the connectors on the vi, respond properly. Have never done it on a tab..

 

Also if I just put the body of the vi on the tab it works fine. So what's the use making this vi ?

 

Hope there is an explanation..

 

Thanks.

Bhal Tulpule

0 Kudos
Message 23 of 26
(508 Views)

This makes no sense and your problem has nothing to do with the tab. The subVI has no idea about the controls in the main VI and you don't show the front panel of the subVI when called. How is this supposed to work??

 

Try this instead. (make sure the subVI front panel is closed before you start the main VI).

0 Kudos
Message 24 of 26
(504 Views)

Hi

I don't understand your comments. esp. "...The subVI has no idea about the controls in the main VI..."

When I go to the front panel of this vi (buttons vi on a tab) and ask to show (Right click > find termnal) it shows me the corresponding item (as an Icon or not) on the BD. So they are all connected. and they are all connected to the correct terminals of the subVI in the BD..

 

I don't know how and why I would have the FP of the subVi pop up as your ..MOD attachment shows.

I have done all my vi's this way (identify all FP controls and outputs as connectors on the vi, copy them onto the FP of a parent vi, insert the subVI on the Block diagram and connect all the icons that show up..) I followed the book (travis and Kring) on this... and it works everytime..

So perhaps you would be kind enough to explain what I am missing..

 

It would be aAppreciated.

 

Thanks.

Bhal Tulpule

0 Kudos
Message 25 of 26
(501 Views)

The event structure is linked to the controls on the subVI front panel. It has no idea about the controls on the main VI. The subVI only knows the values the controls had at the moment the subVI is called.

 

The controls in the main VI are read once and send to the subVI. The subVI only reacts to interactive value changes on the front panel of the subVI.

 

Obviously your earlier (working) subVIs were not interactive and completed on their own. Using event structures is different. Try to remove the event structure from the subVI so it returns immediately based on the value of the booleans.

0 Kudos
Message 26 of 26
(499 Views)