From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open VI Reference to a LabVIEW executable.

Solved!
Go to solution

Hello,

 

I haven't done this for a while and it's not working like expected.  I'm trying to "Open VI Reference" from executable A.exe to B.exe.  I'm trying to get a control value from B.exe in A.exe.  Can someone send me an example?

 

Right now I'm at this stage: I have A.exe running as a LabVIEW executable.  I'm trying to "Open VI Reference" to A.exe from LabVIEW development without success.  Not sure what I'm doing wrong.

 

Don't hesitate to ask more info if you need some.

 

LabVIEW 2012, Windows 8.1.

 

Thanks,

 

Michel

0 Kudos
Message 1 of 15
(5,464 Views)

You need to refeernce the VI that is INSIDE of the exe.  If your exe was built with the 8.x format, then the the VI's location will be A.exe\blah.vi.  If in the newer format, then you need to know the directory structure of the project to get the the VI you want since the newer formats make the executables like a zip file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 15
(5,449 Views)
First you have to get an application reference to the instance of LabVIEW that is running the VI you want to access.

Code?

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 3 of 15
(5,447 Views)
You only need to worry about the directory structure if the VI isn't already in memory. If it is in memory all you need is the name. Static references are your friend.

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 4 of 15
(5,437 Views)

I don't think you can do this with executables.  "Open VI by Reference" is analogous to calling the VI by putting its icon on your block diagram.  What you are trying to do is to execute another executable (which has nothing to do with LabVIEW -- it could be any executable, such as Microsoft Word).  You could uses a System Command (that may be the wrong term), something like going to a Windows Command Prompt and typing the name of the program (the Executable) that you want to run, but it is a little clumsy.

 

BS

0 Kudos
Message 5 of 15
(5,431 Views)
The OP says that the executable was created in LabVIEW.

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 6 of 15
(5,420 Views)

Once you have an Executable, does it matter that the underlying Development system is LabVIEW, rather than (say) Visual Studio, or Matlab?  I suppose you could write an application that "knows" to, for example, listen to a TCP/IP port and interpret/execute commands, but that doesn't sound like the question being asked.

 

BS

0 Kudos
Message 7 of 15
(5,395 Views)

@Bob_Schor wrote:

Once you have an Executable, does it matter that the underlying Development system is LabVIEW, rather than (say) Visual Studio, or Matlab?  I suppose you could write an application that "knows" to, for example, listen to a TCP/IP port and interpret/execute commands, but that doesn't sound like the question being asked.

 

BS


 

LabVIEW-built executables still run as VI's in the RTE, though.  Their identities have not been abstracted away into one single object or anything, and they still have name-based VI server access.

You can configure a build specification to include almost nothing, and require the VI files to be present in expected locations (i.e build specification's data or support directories).  By default, all items in an executable application build specification are set to be put in the same location as their caller, which results in most things going into the .exe file, internally referenced in a directory-esque form like crossrulz mentioned, "MyExecutable.exe\MySubVI.vi".



0 Kudos
Message 8 of 15
(5,384 Views)
Your last paragraph is no longer (since V9) correct. Now the development directory structure is duplicated inside the executable.

You can optionally still tell LabVIEW to use the old flat structure, but there is no good reason to do that.

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 9 of 15
(5,376 Views)

Hello,

 

Lot's of answers, thanks. The 2 executables are LabVIEW built.  I have tried different path option but nothing is working, I must miss something simple here. I will try tomorow with two simple LabVIEW executabe and report the status.

 

Good night,

 

Michel

0 Kudos
Message 10 of 15
(5,362 Views)