LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
DarkLordOfG

Call LabVIEW Exe Function

Status: Declined

Any idea that has received less than 3 kudos within 3 years after posting will be automatically declined.

Right now to call a built application within another LabVIEW application you need to pass parameters via the command line. 

 

http://digital.ni.com/public.nsf/allkb/17C3AD70493CE0208625666A00763364

 

 It would be nice if this would be wrapped into a 

"Call LabVIEW Exe" function that exposes the inputs via terminals as shown below.  It would be nice if the terminals could be labeled as "exposed" in the connector pane.  If exposed then

they are available to the CallLabVIEWExe function.

 

CallLVExe.png

Sorry in advance if this request exists.  I searched but did not find anything similar.

7 Comments
Dennis_Knutson
Knight of NI

If you create a dll instead of an exe, the functionality already exists. I don't see the point.

DarkLordOfG
Member

We create "container" exe's in labview that essentially hold shortcuts to any multitude of other applications created by labview.  Each called application can be passed some generic setup data.  We are not calling a function and returning - they are self contained applications (16 shown below).

 

Studio.png

Dennis_Knutson
Knight of NI

But your request for a new Call LabVIEW Exe function would be calling a function and returning and is no longer just a stand-alone exe. A dll built with the same top level VI that you have with the exe build can have however many input terminals defined as you want and called by the existing Call Library Function Node. Your request would not only require a new function to call just LabVIEW exe's but a whole new way to build an exe itself.

AristosQueue (NI)
NI Employee (retired)

Dennis, I think he wants a "Start EXE with these parameters.vi" -- similar to the Asynchronous Call By Reference node (new in LV 2011), which wouldn't wait for the EXE to finish.

 

rammer, I think the problem would be figuring out those "inputs". An EXE doesn't have any inputs, not even a LV built EXE, other than the command line. That's bound into the definition of an EXE. So the function you're asking for would be creating the command line and then invoking the EXE -- you'd still have to parse the command line on the inside of that EXE. Also, how would LV, looking at an arbitrary EXE, figure out that this is a LV built EXE and from that divine the inputs? I suppose we could compile various signatures into the EXE, but that feels kind of hackish to me. Note that this isn't an area of expertise for me, so if there's an elegant solution for appending information like that onto an EXE, please post it here (bonus points if that mechanism works on all target platforms, Windows, Mac, Linux, pharlap, VXWorks).

DarkLordOfG
Member

Aristos - exactly.  I suppose we could have everything compile to a DLL and use the new Asynchronous Call By Reference node.  users can have many applications running at once, they do not rely on eachother and the calling shell program does not rely on them.

 

My idea was just a simplier, cleaner way to start an exe with certain parameters without having to go into the build properties, build some command line string and then parse it.  I wonder if this VI could simply be a wrapper.  It calls the run by command line and formats the command line string for you.  Then have a vi "set inputs from command line" that does the parsing.  Of course there are a million other ways to do this (make a stanard ini file that all apps read, etc)....

AristosQueue (NI)
NI Employee (retired)

Rammer: Your proposed workaround wouldn't work. You can't call DLLs through the Asynch Call By Ref. You would have to write a DLL that had a public function that is a wrapper and inside that wrapper, the function made the Asych Call and then returned. Once again, you're hitting the wall that these file types -- DLLs and EXEs -- have definition outside NI's control.

 

You could use a packed project library for this purpose instead of a DLL. That's something you might want to look into.

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 3 kudos within 3 years after posting will be automatically declined.