Jump to content

Open VI Reference In Tools Menu VI Failing


Recommended Posts

I have a tool I'm creating and it searches the active project for all VIs recursively. I have found if I try to use Open VI Reference to an unsaved VI it fails (I am wiring up just the VI name as a string). It gives me error 1004, VI not in memory.

However, if I go to that specific project and create a new VI and do open VI Reference with "Untitled x" wired as a string, it opens the reference fine. Does the tools menu somehow run in a different context where it can't open a reference to an unsaved VI? Is there a way to make this work?

I should add, there are no problems when it's saved to disk and wired up as a path (somewhat obviously).

Edited by for(imstuck)
Link to post
Share on other sites

Here is an example. Unzip this to <LabVIEW>/projects. Create a new project and a new VI. You will need to add a comment on that new, unsaved, VIs block diagram that says "test" (omit the quotes). Then run my tool. It should find the VI but when it tries to open a reference to it, it returns an error.

Test Issues Folder.zip

Edited by for(imstuck)
Link to post
Share on other sites

Instead of using the "menu launch information.vi" (which I'm totally unfamiliar with/do not have) try using an application (read) property node -> App.MenuLaunchApp to get the calling application reference. I also use App.MenuLaunchVI to get the name of the VI in memory, but you can only open that vi in memory when wiring the application reference from teh app.menulaunchapp.

I think that the property node I use is not available by browsing.

ok here it is

GetActivationVI.vi

Edited by Jon Kokott
Link to post
Share on other sites

Join the conversation

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

Guest
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.

  • Similar Content

    • By Manudelavega
      Hi,
       
      I am facing a weird situation and would like to get your insights. My application is quite large (>1000 VIs). When I run it, an initialization phase takes place, and around 10 or 20 objects are created (LVOOP). Most of these objects start their engine using the Open VI Reference and then the Run method. If they encounter any warning during that phase, they enqueue a message to display, and a dedicated VI keeps checking this queue and opens a LV Dialog (with just a OK button) when it finds an element. The purpose is to allow the initialization phase to continue instead of waiting for the user to acknowledge the window. Then when the init phase is complete, the user can just acknowledge all the dialogs one after another. (usually there is like 1 or 2, not much more).
       
      I ran my code this morning and was surprised to see that the init phase would still wait for me to acknowledge the dialog. A few probes showed me that the application was stuck in one of the Open VI Reference call. After I acknowledge the window, it would process normally.
       
      I am wondering what is causing this behavior and whether it is a known issue. Could it be related to the fact that the Dialog is modal and somehow holds the thread in which the Open VI Reference executes? This is weird, because other complex operations (connecting to a database,...) manage to execute while the dialog is open...
       
      Thank you very much for your help
       
      Emmanuel
    • By 20Syl
      Hi everyone,
      Actually, I've already found the answer to my question in an old thread in which I saw the following picture. Problem is : I can't find how to create a reference to a group of controls and neither can I find the "Grouped" property used below.
      The old thread dated from 2006. Was this feature removed in more recent releases of LV or I'm just too dumb to find it? Is there another way to interact with group members?
      Thank you!

×
×
  • Create New...

Important Information

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