ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI self-reference

Hi!

I work with LabView 6.02 and would like to get a reference to the current VI inside it
(like "this" pointer in C++). Is there some built-in way to do it or do I need to open reference
to the VI itself using it's path ?

Sincerely,
Sergey.
0 Kudos
Message 1 of 6
(3,421 Views)
If you drop a VI invoke or property node on the diagram leaving the ref input unwired, the node will implicitely apply to "this" VI.

Jean-Pierre


LabVIEW, C'est LabVIEW

Message 2 of 6
(3,421 Views)
A little bit of caution, however. If you intend to open a self-reference in order to keep the VI running Top Level in background, use an explicitly opened reference. Implicit refnums are different from explicit refnums as thay do not keep a VI in memory if its panel is closed.

Jean-Pierre


LabVIEW, C'est LabVIEW

0 Kudos
Message 4 of 6
(3,421 Views)
> A little bit of caution, however. If you intend to open a
> self-reference in order to keep the VI running Top Level in
> background, use an explicitly opened reference. Implicit refnums are
> different from explicit refnums as thay do not keep a VI in memory if
> its panel is closed.
>

I've tried it, but got a "Not a refnum" error message. I saw this solution in DejaNews
archives of 1999, but then it was related to LabView 5. Maybe it's different in 6i ?
Do you have a working example ?

Thank you,
Sergey.
0 Kudos
Message 5 of 6
(3,421 Views)
Ooops, now it does work !


"Sergey Rosenblum" wrote in message news:9s9go6$q3l$1@news.huji.ac.il...
> > A little bit of caution, however. If you intend to open a
> > self-reference in order to keep the VI running Top Level in
> > background, use an explicitly opened reference. Implicit refnums are
> > different from explicit refnums as thay do not keep a VI in memory if
> > its panel is closed.
> >
>
> I've tried it, but got a "Not a refnum" error message. I saw this solution in DejaNews
> archives of 1999, but then it was related to LabView 5. Maybe it's different in 6i ?
> Do you have a working example ?
>
> Thank you,
> Sergey.
>
>
>
>
>
0 Kudos
Message 6 of 6
(3,421 Views)
As Jean-Pierre said, just drop a property or invoke node on the diagram. You just need to make sure you change the "VI Server Class" from "Application" to "VI" by selecting "Select VI Server Class>>VI" from the pop-up menu.

Brian
0 Kudos
Message 3 of 6
(3,421 Views)