annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

Stopping Subvi and returning a value from SubVI to MainVi

Risolto!
Vai alla soluzione

Hi All ,

 

I have a MainVI which calls a SubVI . The call to the SubVI from the MainVI is done inside a while loop . If the computation time taken in Subvi exceeds say 1 second I want to stop the subvi and in parallel I want to feed a default value to the MainVI that is suppose to be given by the SubVI . With the next iteration i have to call the SubVI again to do my task . Please let me know how this can be done Thanks in Advance .

 

Regards,

Magi

 

0 Kudos
Messaggio 1 di 6
3.145Visualizzazioni

Put an elapsed time express VI in the loop of the subVI so that its loop stops if it takes longer than a second.

 

0 Kudos
Messaggio 2 di 6
3.136Visualizzazioni

Thanks for your valuable input . In the process of stopping the SubVI i will not be able to deliver the required value to the mainVI.Can you please let me know how can i let the mainVI know the SubVI has been terminated due to the Time out condition and how should i take the default value instead of taking the value from SubVI(which on conditional termination will not deliver a value at all ) and vice versa if the SubVI works perfectly fine .Thanks in Advance .

Regards,

Magi

0 Kudos
Messaggio 3 di 6
3.117Visualizzazioni
Soluzione
Accettato da magi20

Magi,

 

The subVI terminals will always have some value when the subVI returns.  If you do not set any other value, the value will be the default. Add a boolean output from the subVI to indicate whether it timed out or terminated normally.  Test that boolean in the main VI to see whether the data value is valid or not.

 

The questions you are asking are very fundamental to the way LabVIEW works. I suggest that you sepnd some time with the on-line tutorials on Getting Started With LabVIEW. What you learn there will more than make up for the time you spend asking basic questions.

 

Lynn

0 Kudos
Messaggio 4 di 6
3.110Visualizzazioni

Lynn ,

 

Thanks a lot for the input . I would take ur advice and will work on the same .

 

Regards,

Magi

0 Kudos
Messaggio 5 di 6
3.106Visualizzazioni

Then please mark the most helpful post as solution, and not your own. You can unmark the current solution from the options menu.

0 Kudos
Messaggio 6 di 6
3.103Visualizzazioni