04-04-2013 08:10 PM
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.
04-05-2013 05:22 PM - edited 04-05-2013 05:23 PM
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