LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

findout path of vi already in memory from .NET app

 

From a .Net application, how do I findout the path of a VI already loaded and running ?

 

I tried this code, which resulted in an exception:

 

lv = new LabVIEW.ApplicationClass();

string vipath = "MYVI.vi"

vi = lv.GetVIReference(vipath,"", false, 0);

 

Exception:

System.Runtime.InteropServices.COMException (0x00001B21): LabVIEW:  Open VI Reference no longer matches VIs in memory by filename. A filename is no longer sufficient because the full name of a VI now includes any owning libraries.

 

Looks like GetVIReference(...) needs the absolute path.  But in my case, I am trying to findout what the path is.   Is there another method I can try ?

 

Thanks,  ert.

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

Hi eetrr, 

 

I think this VI might give a good idea for what you want to do. Try implementing this VI changing open VI reference to open application reference. 

 

https://decibel.ni.com/content/docs/DOC-7658

 

This will provide the file path of the VI. You will then need to use this second example as guide to help you interface between the path finding VI and your .NET application.

 

https://decibel.ni.com/content/docs/DOC-25663

 

 

Ryan
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,350 Views)