LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting the Active VI

I've created a tool for editing a VI's description. The tool presents a list of VIs in a directory. After double-clicking on a VI the VI's front panel is opened, the connector pane image is displayed (thank you scripting), and the current description is shown. Currently I have this saved in my project folder so it shows up in my Tools menu. My problem is that when I run the tool via the tools menu, I can't click on the VI I'm editing to set it as the Active VI and I can't see how to do this with property or invoke nodes. When I run my tool as a regular VI (not via the Tools menu), I don't have this problem. Any ideas???

No I cannot post my VI (internal network not connected to the internet).

"All truths are easy to understand once they are discovered; the point is to discover them." -- Galileo Galilei

0 Kudos
Message 1 of 4
(3,869 Views)

i had the exact same problem a while ago, there is a thread on LAVA, i'll try to find it again.

basically, when your VI is launched from the tools menu, it runs in a different "context" (=application instance) from the one your project VIs are in.

so your "utility VI", when launched from the tools menu has to get the application reference of your project.

see this :

Clipboard01.png

Hope this helps

EDIT :

here is the thread i was talking about : http://lavag.org/topic/9273-accessing-vis-across-contexts/


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 4
(3,088 Views)

There's also a great full example of integrating a scripting VI into the Tools menu in the docs section.

Chris Bolin
LabVIEW Partner Program, CLA
0 Kudos
Message 3 of 4
(3,088 Views)

Thanks...I'll look at these when I get a chance. Initial glance give me hope...

"All truths are easy to understand once they are discovered; the point is to discover them." -- Galileo Galilei

0 Kudos
Message 4 of 4
(3,088 Views)