LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

call sub-vi

I used an open reference to open a sub-VI and run it in the Main VI, but the sub-VI only runs when I open the sub-VI manually in advance and then hit run on the Main VI. If I just run the Main VI without opening the sub-VI manually in advance, nothing happens, I do not get any data. Does anybody know why this happens?
0 Kudos
Message 1 of 7
(3,267 Views)
Where is your data going, to a file, the main vi, or the front panel of the
sub-vi? If it's the fp of the sub-vi, are you opening the fp using an
invoke node? If you can't get the fp to open, there's something wrong with
the inputs to the open vi reference function. Do the open vi ref. function
or the invoke nodes return any errors?

Dan.

"analog" wrote in message
news:50650000000800000005AF0000-1068850981000@exchange.ni.com...
> I used an open reference to open a sub-VI and run it in the Main VI,
> but the sub-VI only runs when I open the sub-VI manually in advance
> and then hit run on the Main VI. If I just run the Main VI without
> opening the sub-VI manually in advance, nothing happens, I do not get
> any data. Does anybody know why this happens?
0 Kudos
Message 2 of 7
(3,267 Views)
> I used an open reference to open a sub-VI and run it in the Main VI,
> but the sub-VI only runs when I open the sub-VI manually in advance
> and then hit run on the Main VI. If I just run the Main VI without
> opening the sub-VI manually in advance, nothing happens, I do not get
> any data. Does anybody know why this happens?

There are two ways to get a VI reference, by name and path, and simply
by name. By name works fine if the VI is already in memory, but fails
with an error when it isn't. The first thing you might want to do is to
wire up the error I/O and check the result using the Error Handler VIs.
Or if using LV7, turn on the handling of unwired errors in the
Tools>Options dialog and in the VI Settings Dialog>Execution page.

Greg McK
askle
Message 3 of 7
(3,267 Views)
I am using LV7, but I don't see the Execution page that you are talking about. Are you talking about the General Error Handler function? I do not get any error when I hooked up all of the error out cluster. But I see that the main VI opens the sub-VI and then stop running while the sub-VI just continue workings...if I have both of them opens...
Download All
0 Kudos
Message 4 of 7
(3,267 Views)
Sorry, I attached the wrong main. This is what I actually use to call the sub-VI. It was working yesterday just fine, I was able to get the data in the main VI as the sub-VI runs, the only problem was the sub-VI needs to stay open. So I tried to fix this problem, and now I cannot even get the data from the sub-VI for some reason. I think the problem is the case statement, the index array gives a default value after you run the sub-VI's case. I need to be able to change the order of my tests, and also be able to see other test clusters in the list while a test is running, so that's why I had two cases statement. But I was able to do all of this last night, so I am very confused. And now it seems like LabView crashes every 4-6 times I ran
the main. Thanks much...
0 Kudos
Message 5 of 7
(3,267 Views)
Would it be possible for you to simplify the main program and the subVI, eliminating any other dependencies so that I might run your porgram on my computer?

Thanks,
-Erik
0 Kudos
Message 6 of 7
(3,267 Views)
Hm....I have looked back, and simplifying would take a very long time to do....And I have counted all the VI's and there are a total of 9 VI's...If you want, I can try and mail them all to you....But I have fixed my problem...and now I have encountered another problem....I got the VI to open, but I want it to finish running before the next item runs. But now the Main just runs the next item without waiting. How do I get it to wait and run the next item in the list only after the VI is done running....Thanks.
0 Kudos
Message 7 of 7
(3,267 Views)