LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

path of vi in exe

Solved!
Go to solution

Hi All,

 

I want to manipulate a vi in the EXE from LabVIEW development system. I have the application running and listening at port 3364. From LV development system I can open an app reference using the port 3364 and get the names of all the vi's in that app's instance but I do not know the path of the vi that I want to access so I can't open a VI reference to that vi. 

 

How do I get the path of the vi or open a reference to a vi inside EXE?

 

Thanks,

Ritesh

0 Kudos
Message 1 of 8
(2,569 Views)
What version of LV? Starting from nothing it can be difficult, but assuming you are using a recent version of LV (2009 or later) there is a way. The important thing to remember is that by default the VI path inside an executable mirror the file paths in the development environment. So if you have a known starting point (like the path to the top level VI in the executable, you can build a path to the dynamic VI the same as you would in development.
One big thing to remember is that when building the executable you have to explicitly include the dynamically called VIs.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 8
(2,559 Views)

 Very Good Question.  From my understanding an exe runs under the run time engine and not the LAbView.exe thread. I know Vi server works with vi's that are included in the build for the exe but not vi's from the development environment. Would be nice to use ques, events or notifiers to control other vi's or other labview built .exe  files.

0 Kudos
Message 3 of 8
(2,553 Views)

Mike,

 Is a vi compilled into a DLL able to be called by both an.exe and a vi in the Labview developement enviroment? 

0 Kudos
Message 4 of 8
(2,545 Views)
You can call LV-generated DLLs from LV executables and the LV development environment. The only problem is that sometimes calling LV-built DLLs from within LV doesn't always work as intended.

Also you can essentially use queues and events between executables -- all you need is a little help from VI server.

The thing to remember is that when you use VI server to execute a VI that VI actually runs on the target where it physically resides. So if the VI you call remotely serves to put data into a queue or fires an event...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 8
(2,532 Views)

Mike,

 

I am using LV 2013. If I use the development environment path then I get error 1445 "Error -1445 occurs when the path datatype cannot provide sufficient location information to open a VI reference."

From the application's reference I get the names of the vi's that are in the memory and it shows the name of the vi that I want to access. So, I used the application's reference and the vi name to open the vi reference and I do not get any error in the open vi reference function. But when I try use any property method using the new vi reference I get an error 1026 "LabVIEW:  VI Reference is invalid." I would believe that this method should work but it doesn't. And I can't think of any more ideas to try out.

 

I do include dynamically called vi's in the EXE.

 

Ritesh

 

0 Kudos
Message 6 of 8
(2,524 Views)
Solution
Accepted by topic author LVCoder
Ok, well that is much simplier. If the VI is already in memory you don't need to worry about paths. All you need is the VI's name. You will notice that the path input will also accept a string.

You will have to give the complete name including the name of any lvlib or class that it might be in. For example, if a VI named myVI.vi is in a library named myLibrary.lvlib, the complete name would be myLibrary.lvlib:myVI.vi (note the colon connecting the names).

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 7 of 8
(2,519 Views)

Got it, thanks!

I was closing the application'sreference before opening the vi ref, that's why it was throwing the error. It works now. Thanks.

0 Kudos
Message 8 of 8
(2,417 Views)