12-30-2014 03:36 AM
Hi all
I've searched the solution to my problem, but didn't find.
Short brief:
I have a VI that uses for authorization, then if all O.K it should open other VI("code-vi") and run it and close itself.
I saw that some people recommended , that it can be done by just putting the "code-vi" in the right place, but when I'm following this method , the authorization VI can't be closed.
the other method I tried is to put a sequence where the first stage is opening the "code-vi" with "vi server ref" and the second stage is close this VI also with "vi server ref". with this method i'm facing two problems , the first is the fact that all the vi's are within a project , and I want that the "path refernce" would be generic - I can put the folder that holdes all the files in any PC and it would run without redirecting the path.
The second problem is that I can't find the way to automaticaly run the "code-vi" when it invoked.
which files should I attach if i'm using project ?
Solved! Go to Solution.
12-30-2014 06:27 AM
When you call the new VI, close the current VI's front panel. Use an Invoke Node (Front Panel->Close). No need to get references or anything. Just have the Authorizing VI close itself.
12-30-2014 06:35 AM
thank's crossrulz
"Call the VI" meaning just drag the VI file into the block diagram ?
and how do I know the callling the VI would run before the closing of the current VI.
I think I mangaed doing that using sequence but with reference, attached.
also this auth.vi sits in the project and I want to run it automatically when I double click on it in the project explorer , how can I do it ?
12-30-2014 06:41 AM
No need for the sequence structure. The error wires are forcing the order with data flow.
There is a VI property to run when opened. We normally do not set that just because it is a pain when debugging and whatnot.
12-30-2014 06:44 AM - edited 12-30-2014 06:53 AM
thanks
oh
sorry but still when I double click on the auth.vi in the project explorer it doesn't run.
12-30-2014 08:40 AM
And it shouldn't do that.
When you click and open a vi from the Project Explorer you want the vi to be in a state where you can edit the vi.
If you want to run the vi, then click on the white arrow or press F5.
12-30-2014 10:55 AM
🙂 that's I understand , so from your answer I can't configure it as for a VI that it is not in project -> VI properties , execution.
12-30-2014 11:08 AM
@UdiWeiss wrote:
so from your answer I can't configure it as for a VI that it is not in project -> VI properties , execution.
I'm not sure what you are trying to say here. The "Run When Opened" property for the VI doesn't care how the VI was opened, just that it was opened.
12-31-2014 01:53 AM - edited 12-31-2014 02:16 AM
Not sure how to implement your suggestion.
I tried to put "This VI" reference and connected it to property node "Run When Open" as you can see in the image.
saved it , closed it, and re opened it by double click on it in the project explorer - still won't run automatically.
12-31-2014 03:00 AM
@dkfire wrote:
If you want to run the vi, then click on the white arrow or press F5.
What is F5 supposed to do.. ?!