To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example shows how to use the LabVIEW System Exec.vi function to kill a task in Windows OS
Description
Using the LabVIEW System Exec.vi function you can make a taskkill call to the Windows OS. The attached VI takes the task name as a string and will kill the named task through the Windows console. Task names are as they appear in the task manager
In the attached VI the first part of the command is provided. You simply needs to input the process name and the VI appends the strings to make the full command.
Requirements
LabVIEW Base Development System 2012 or compatible
Steps to Implement or Execute Code
Additional Information or References
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange. **
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
How do we use keyboard shotcuts like Ctrl+C and insert it to terminate a process?
I created a vi to kill Python System Exec.vi calls that you may have found to have hung in MacOS (I am using 11.6 Big Sur)
It looks for the PID (process identifier) number of a single Python.app occurrence that may exist and then kills it so that the Python System Exec.vi call that hung releases.
You can use it to kill other System Exec.vi -type calls if you use the ps -ax command in Terminal and see which unique line item it creates, and put it in the "String to scan for" field.
There are probably more elegant and simpler ways to do it, but, this is what I have.
http://soundboardmaterial.pbworks.com/w/file/147204078/Find%20Python%27s%20PID%20and%20Kill.vi
LabVIEW '21