LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Quirk, Open VI Reference and LLB

I found a strange quirk opening a VI Reference (on a PXI).  The "normal" method of doing this is to Open Application Reference (to find the remote site) then to Open VI Reference with the path to the desired VI.  Darren Nattinger pointed out (in 2006) that you can use just the name of the VI, provided the VI is on the same folder or LLB as the current VI.

 

Caveat -- this behavior is present in LabVIEW 7.0 (I'm maintaining some "legacy code").  I suspect it will be present in later versions, but haven't (yet) tested it.

 

Quirk 1 -- if the VI in question has been downloaded (or deployed) to the remote site, and hence is in memory, then the "path" information isn't used, only the VI name.  Thus if you have a path "C:\ni-rt\startup\MyVI.vi" specified in the Open VI Reference, but have absolutely nothing in the startup folder on your PXI, but have "deployed" your Project, this call will work, even though the "path" part of the argument is not valid.  Useful when testing.

 

Quirk 2 (and the "real" reason for this post) -- if the VI is embedded in an LLB, it depends on whether or not it is a "Top-level" VI or not.  Suppose the path is C:\ni-rt\startup\MyLib.llb\MyVI.vi.  Consider two VIs in this LLB -- TopLevel.vi and SubVI.vi (where TopLevel is at the top level of the LLB, whereas SubVI is not).

Case A -- the LLB has actually been downloaded to the remote site.  Doing an Open VI Reference, with either the full path or just the VI name, works, whether or not you are calling TopLevel or SubVI.  Nothing surprising here.

Case B -- you are taking advantage of Quirk 1, and have not actually put the file on the Remote site (i.e. there is nothing at the path specified).  You have, however, downloaded the LLB to the Remote.  Doing an Open VI Reference with SubVI, whether with full path or just VI name, works fine.  However, trying to open TopLevel fails, with Error 7 (File Not Found), whether using full path or VI name.

 

Summary -- Quirk 2 is that Quirk 1 has a quirk if the VI being referenced is a top level VI in an LLB.

 

[My apologies if this is common knowledge -- I failed to find this behavior documented, but may have overlooked something].

 

0 Kudos
Message 1 of 2
(2,751 Views)

Bob Schor wrote:

I found a strange quirk opening a VI Reference (on a PXI).  The "normal" method of doing this is to Open Application Reference (to find the remote site) then to Open VI Reference with the path to the desired VI.  Darren Nattinger pointed out (in 2006) that you can use just the name of the VI, provided the VI is on the same folder or LLB as the current VI.

 

Caveat -- this behavior is present in LabVIEW 7.0 (I'm maintaining some "legacy code").  I suspect it will be present in later versions, but haven't (yet) tested it.

 

Quirk 1 -- if the VI in question has been downloaded (or deployed) to the remote site, and hence is in memory, then the "path" information isn't used, only the VI name.  Thus if you have a path "C:\ni-rt\startup\MyVI.vi" specified in the Open VI Reference, but have absolutely nothing in the startup folder on your PXI, but have "deployed" your Project, this call will work, even though the "path" part of the argument is not valid.  Useful when testing.

 

Quirk 2 (and the "real" reason for this post) -- if the VI is embedded in an LLB, it depends on whether or not it is a "Top-level" VI or not.  Suppose the path is C:\ni-rt\startup\MyLib.llb\MyVI.vi.  Consider two VIs in this LLB -- TopLevel.vi and SubVI.vi (where TopLevel is at the top level of the LLB, whereas SubVI is not).

Case A -- the LLB has actually been downloaded to the remote site.  Doing an Open VI Reference, with either the full path or just the VI name, works, whether or not you are calling TopLevel or SubVI.  Nothing surprising here.

Case B -- you are taking advantage of Quirk 1, and have not actually put the file on the Remote site (i.e. there is nothing at the path specified).  You have, however, downloaded the LLB to the Remote.  Doing an Open VI Reference with SubVI, whether with full path or just VI name, works fine.  However, trying to open TopLevel fails, with Error 7 (File Not Found), whether using full path or VI name.

 

Summary -- Quirk 2 is that Quirk 1 has a quirk if the VI being referenced is a top level VI in an LLB.

 

[My apologies if this is common knowledge -- I failed to find this behavior documented, but may have overlooked something].

 


This will likely not apply at all to >= 8.0. LabVIEWs Open VI Reference will now distinguish cleanly between absolute path and just the VI name itself. If you use just the VI name the VI needs to be in memory or for a built application included in the app. The quirk about VIs in the same LLB as the currently active VI sounds very strange to me but it may still work.

 

However if you specify an absolute path, Open VI Reference will bark with an error if the VI can not be found at that location or if the VI already loaded in memory with that name has not the same absolute path. This is supposedly to make it very hard to create cross linking even when using VI server.

 

Rolf Kalbermatter

 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 2
(2,729 Views)