LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SystemExec PID

Is there any way to run SystemExec and get it to output the PID of the created CLI?  I don't think there's a way built into LabVIEW, so any other CLI code that could do this reliably would be helpful.  I tried to start the exe with a unique window title, but it always seemed to just default back to "GDI+ Window(test.exe)" or "theAwtToolkitWindow", whatever those mean.  Any help in understanding these and getting the PID back would be greatly appreciated, thanks!

0 Kudos
Message 1 of 4
(536 Views)

As a little help with understanding - this is what happened when app (powershell in this example) called from LabVIEW and how process tree looks like:

snippet3.png

So, the Parent for powershell.exe is not the cmd console, but LabVIEW.exe. And the window which is appeared is conhost.exe, is the Windows Console Host.

May be it is better and easier to get PID from inside of application which you calling from LabVIEW.

0 Kudos
Message 2 of 4
(498 Views)

The OpenG Pipe library has this functionality. I never released it as a package but it is downloadable from here: https://forums.ni.com/t5/LabVIEW/Controlling-the-STDIN-STDOUT-of-a-legacy-application-in-LabVIEW/m-p...

 

The source code is here if you are inclined to dig into C programming: https://sourceforge.net/p/opengtoolkit/svn/HEAD/tree/trunk/lvpipe/

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 4
(456 Views)

@rolfk wrote:

The OpenG Pipe library has this functionality.


Thank you, Rolf, it works as well:

Screenshot 2024-01-30 15.38.29.png

0 Kudos
Message 4 of 4
(441 Views)