03-01-2018 02:11 PM
I would like to use the Call Executable step to Start an EXE (Executable) file which will run until I call another step to tell it to stop in my test sequence. Basically, I want to be able to turn on the EXE and turn off the EXE when I want to inside the test sequence. The EXE continuously pings a device. Is there an efficient way to do this? Thanks!
03-02-2018 05:31 PM
testdesign,
Could you use LabVIEW VI's to run the executable on the Windows level then end its process?
Here are the instruction for using this process:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P821SAC
http://digital.ni.com/public.nsf/allkb/80432B061C5A4C888625705400737BE8
VanCamp
03-05-2018 10:06 AM
I don't see a reason to use LabVIEW for this. The call executable step will let you specify a wait condition and store a handle to the spawned process:
You can either use the Process Handle to terminate the executable through the Windows API, or you could call taskkill from another call executable step to kill the process by name. Note: neither one of these options will end the process "cleanly"(if it has a handle open to an instrument, that handle will probably not be closed properly). To close an executable cleanly, you'd need to expose an exit function from within that application, or do something similar to what's described here.
-Trent
12-27-2018 03:57 AM
Can someone please be more specific on how to "You can either use the Process Handle to terminate the executable through the Windows API"?
12-27-2018 09:20 AM
Hey,
Refer to this documentation or this one (for a more python focused one) for more clarification on how to use the Windows API to terminate a process using the process handle.
Thanks,
Roxy
12-27-2018 09:55 AM
Thanks!
I will keep in in mind as I found a solution for using Python Steps without Call Executable and thus the process automatically runs and gets killed when needed.