Jump to content

Getting Active VI


Jon Kokott

Recommended Posts

When launching a tool from the tools menu option of a given VI (tool residing in the labview 2010/project directory)

How do I get the VI that activated the tool?

Currently I'm using App.VIOfTopBD, but this does not always return the right VI if the block diagram wasn't the last one open.

I'd rather not monitor every activated VI with some sort of a daemon (similar to what is done on the sub VI fixer script engine)

(I prefer not to launch any tools at start, trying to run as lean as possible.)

~Jon

Link to comment

Note that you should also use the application reference to account for the possibility of the VI loading in another instance:

post-1431-0-44867700-1298474572_thumb.pn

The properties are private (indicated by the brown color and documented in their context help), which is why you can't see them.

could you send the VI for that. (that property is also a super secret public)

I am aware of application instance, however, I was using a significantly more convoluted method involving getting the last active bd to owning application.

~Jon

Link to comment

Refer to the bottom of this post to see how to enable the private properties/methods.

Correct me if I'm wrong,

I have all scripting features enabled (as far as I can see)

the supersecretestuff=true flag hasn't done anyting in a lone time.

The origins of that property are likely that it was leaked from the NI alliance member "stuff" (whatever that is)

~Jon

Link to comment

could you send the VI for that. (that property is also a super secret public)

I am aware of application instance, however, I was using a significantly more convoluted method involving getting the last active bd to owning application.

~Jon

Install this package from JG. It's a repack from Aitor's Scripting Workbench.

You'll have all the super secret stuff you need at the tips of your mouse: Tools menu.

Darn, you're quick! :D

Congratulations on 1000 popsts!

-Scott

thanks. :cool:

Link to comment

Correct me if I'm wrong,

I have all scripting features enabled (as far as I can see)

the supersecretestuff=true flag hasn't done anyting in a lone time.

There were two ini keys, one for scripting and one for additional private features. True the scripting key hasn't worked for some time as NI switched to requiring activation for scripting and then making it publically available as option that can be an enabled.

The other key still works for some of the additional private items. However the scripting workbench that Francois points to may be a better option for you depending on your needs.

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.