LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

kill process vi

Hallo,
I need a VI that kills a running process that does not have a window under windows 2000. I am using LabVIEW 6.i.
I tried to convert a VB code that works to LabVIEW but the program I generated crashes LabVIEW all the time at different places. I used the Kernel32.dll and Psapi.dll in that VI.
The Message says that an Area of memory could not be read. I am really interessted why that happened and why LabVIEW crashes, because I want to use Windows dlls in the future.
But first priority is to get a VI that terminates a running process. I would be very thankful for that.
Greetings Dermot
I appended my code. It is a bit chaotic - sorry. Did not have much time.
0 Kudos
Message 1 of 16
(7,512 Views)
You can use the "kill" command with SystemExec. The command line should be "kill //f". The f option forces process termination. I have a vi that does this but it is in LV7.1.
- tbob

Inventor of the WORM Global
Message 2 of 16
(7,508 Views)
I don't think "kill" is a standard command on Windows. If "kill" doesn't work, you can try "taskkill".
0 Kudos
Message 3 of 16
(7,508 Views)
The message "An area of memory could not be 'read'" is common and there are lots of reasons why it could be failing. Calling external code is advanced, and if it is not configured exactly correct, it can crash. Be sure that you are using the correct calling convention and the arguments are exactly the same.
-Lars
0 Kudos
Message 4 of 16
(7,508 Views)
I am using Windows2000, and kill is a standard command. Open up a command prompt window then type kill /?. This should display the help file for the kill command. If you get command not found error, then it is not a valid command.
- tbob

Inventor of the WORM Global
Message 5 of 16
(7,508 Views)
I have XP. Maybe it changed.
0 Kudos
Message 6 of 16
(7,508 Views)
"tbob" wrote in message
news:50650000000500000090D40100-1079395200000@exchange.ni.com...
> I am using Windows2000, and kill is a standard command. Open up a
> command prompt window then type kill /?. This should display the help
> file for the kill command. If you get command not found error, then
> it is not a valid command.

I'm using w2k, and both taskkill and kill are no known commands....

Regards,

Wiebe.
0 Kudos
Message 7 of 16
(7,508 Views)
Why does kill work on my Win2K machine? I can open up a command window and type kill id# and it works. I also have a vi that passes the kill command to system exec and it works also.
- tbob

Inventor of the WORM Global
Message 8 of 16
(7,508 Views)
Dermot,

Try it like this. I couldn't figure out exactly what was wrong, so I rewrote
the vi...

Be carefull with the input name. If you just type "a", all processes with a
"a" anywhere in any of the module paths are killed. Also, be aware that the
"\" has a different meaning in the match pattern function.

Regards,

Wiebe.

"Dermot1000" wrote in message
news:506500000008000000D7F90000-1079395200000@exchange.ni.com...
> Hallo,
> I need a VI that kills a running process that does not have a window
> under windows 2000. I am using LabVIEW 6.i.
> I tried to convert a VB code that works to LabVIEW but the program I
> generated crashes LabVIEW all the time at different places. I used the
> Kernel32.dll and Psapi.dll in that VI.
> The Message says
that an Area of memory could not be read. I am really
> interessted why that happened and why LabVIEW crashes, because I want
> to use Windows dlls in the future.
> But first priority is to get a VI that terminates a running process. I
> would be very thankful for that.
> Greetings Dermot
> I appended my code. It is a bit chaotic - sorry. Did not have much
> time.



[Attachment Close Process.vi, see below]
Message 9 of 16
(7,508 Views)
Thank you for the reply, but I can't open the vi because I only have LabVIEW 6.0. Can you save the VI for 6.0 and repost it?
Greetings Dermot
0 Kudos
Message 10 of 16
(7,508 Views)