From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-05-2013 09:01 PM
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
Solved! Go to Solution.
01-05-2013 09:48 PM
Put an elapsed time express VI in the loop of the subVI so that its loop stops if it takes longer than a second.
01-06-2013 11:38 AM
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
01-06-2013 12:13 PM
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
01-06-2013 12:22 PM
Lynn ,
Thanks a lot for the input . I would take ur advice and will work on the same .
Regards,
Magi
01-06-2013 12:24 PM
Then please mark the most helpful post as solution, and not your own. You can unmark the current solution from the options menu.