Jump to content


Photo
- - - - -

Open VI Reference In Tools Menu VI Failing

property nodes vi reference tools

  • Please log in to reply
4 replies to this topic

#1 for(imstuck)

for(imstuck)

    Very Active

  • Members
  • PipPipPip
  • 152 posts
  • Location:Texas
  • Version:LabVIEW 2012
  • Since:2008

Posted 20 June 2012 - 02:41 PM

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), 20 June 2012 - 02:50 PM.

CLA (but still always learning)

#2 Jon Kokott

Jon Kokott

    Very Active

  • Members
  • PipPipPip
  • 176 posts
  • Location:Milwaukee, WI
  • Version:LabVIEW 2010
  • Since:2006

Posted 20 June 2012 - 02:47 PM

Is the application reference of the open VI reference VI wired with the same application reference it exists in?
Certified LabVIEW Architect

#3 for(imstuck)

for(imstuck)

    Very Active

  • Members
  • PipPipPip
  • 152 posts
  • Location:Texas
  • Version:LabVIEW 2012
  • Since:2008

Posted 20 June 2012 - 02:58 PM

The application reference I have wired up is the one returned from "menu launch VI information.vi"
CLA (but still always learning)

#4 for(imstuck)

for(imstuck)

    Very Active

  • Members
  • PipPipPip
  • 152 posts
  • Location:Texas
  • Version:LabVIEW 2012
  • Since:2008

Posted 20 June 2012 - 03:19 PM

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.

Attached Files


Edited by for(imstuck), 20 June 2012 - 03:19 PM.

CLA (but still always learning)

#5 Jon Kokott

Jon Kokott

    Very Active

  • Members
  • PipPipPip
  • 176 posts
  • Location:Milwaukee, WI
  • Version:LabVIEW 2010
  • Since:2006

Posted 20 June 2012 - 04:02 PM

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

Attached Files


Edited by Jon Kokott, 20 June 2012 - 04:03 PM.

Certified LabVIEW Architect





Also tagged with one or more of these keywords: property nodes, vi reference, tools