Jump to content

Open Vi Reference works only for This VI


0_o

Recommended Posts

Hi guys,

what am I missing?

I was trying to get the default owning app version of an external vi yet I always get an error 7 for giving a bad path unless I connect the path from This VI.

I attached a snippet.

where is ??? represent the option to connect the upper option or the constant option to the path connector.

If you wonder why I need it then this is the reason:

I wrote a vi that opens my projects in the requested LabVIEW version (among other stuff).

However, there are some projects that always open with the older version for example, thus, instead of writing it down I'd like to LV to tell me which version it was last loaded with so I could open it correctly.

BTW, I'm using System Exec.vi to open projects yet even though I specify the LabVIEW version and and the project's path, many times LV still opened the project in the wrong LV (opens with the last LV version that was opened).

Do you know how to deal with that maybe?

Thanks in advance,

Dror.

post-18598-0-47472900-1313065011_thumb.j

Edited by 0_o
Link to comment

I'm not sure what your question about opening the VI reference is exactly, but in any case, you should note that what you're doing will not help you in determining which version the VI was saved in. To do that, you need to call the Application class method Get VI Version and give it the path to the VI.

Also, there's a utility called the Dataact Version Chooser which should already do this, so you might be better off using that. I haven't used it myself, so I can't comment on how it works.

Link to comment

I'm not sure what your question about opening the VI reference is exactly, but in any case, you should note that what you're doing will not help you in determining which version the VI was saved in. To do that, you need to call the Application class method Get VI Version and give it the path to the VI.

Also, there's a utility called the Dataact Version Chooser which should already do this, so you might be better off using that. I haven't used it myself, so I can't comment on how it works.

Cool!!! it worked like magic! Instead of searching the property node under this vi I should have searched for it under this application. Thanks!!!

I also took a look at DataAct and it appears I just wrote down something very similar to what they did only my project also takes care of Builds and TSVN.

I don't know what to do now. I was about to share my work here for free but now I just feel bad for those guys since it is their only merchandize.

Anyhow, thanks again for always coming to my rescue.

Dror.

Link to comment

If you just use the Application property node without any refnum wired in, it will give you the current app, which it looks like you were trying to dig out with all that code. You can also change the "This VI" refnum constant into a "This Application", but that's the same as not wiring in the refnum at all.

Jason

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.