PA-Paul Posted December 20, 2011 Report Share Posted December 20, 2011 Hi All, I have a bit of an annoying problem. I've written an application which acts as a remote server and controls some external kit. A client PC can connect to the server and then remotely operate said external kit. In general, it works fine. But it appears that there's an instability of some kind with the dll supplied by the external kit manufacturer which causes my application to intermittantly fall over and die (with a nice windows: "This program is no longer working" error message). When this happens the client can no longer communicate with the server since its obviously fallen over and died! For various reasons I don't think the manufacturer will be solving the dll issue, which leaves me somewhat stuck. However I had a thought which was to split my application into two sections - one which deals with incoming and outgoing communications from the client and then passes them onto the second application which controls the kit. Then if the "kit controller" falls over, the communications part can detect that (as it wont reply any more) and then restart the application. To do that, I need to be able to programmatically kill the "kit controller" application and clear out the windows error and then re-launch it before continuing. In the meantime I don't lose communications since that part of the system is kept separate... Anyone got any thoughts on whether I can actually do this using labview? If not, any alternatives? Thanks in advance! Paul Quote Link to comment
dannyt Posted December 20, 2011 Report Share Posted December 20, 2011 If you cannot find anything else this may work as a fallback with a Windows systems http://technet.microsoft.com/en-us/library/bb491009.aspx taskkill Quote Link to comment
Liang Posted December 21, 2011 Report Share Posted December 21, 2011 Here is the example of opening on screen keyboard, and closing it. taskkill osk.zip Quote Link to comment
PA-Paul Posted December 21, 2011 Author Report Share Posted December 21, 2011 Liang - that didn't seem to work. The osk came up fine, but when I ran the osk kill vi, I saw a cmd window popup and then dissapear - but the osk stayed on the screen... I'll try it with a couple of other things to see if it will work. Thanks Paul Just tried takskill on the osk within a cmd window and it doesn't like it for some reason (access is denied!) but it does work on other applications, so it should work for what I want to do. Thanks Paul Quote Link to comment
swenp Posted December 21, 2011 Report Share Posted December 21, 2011 You could use .NET to kill a process by name: Quote Link to comment
dannyt Posted December 21, 2011 Report Share Posted December 21, 2011 swenp, Thanks for that one, I will have to play with that method and se how it goes. I like being able to do things internally if possible Quote Link to comment
Liang Posted December 22, 2011 Report Share Posted December 22, 2011 Liang - that didn't seem to work. The osk came up fine, but when I ran the osk kill vi, I saw a cmd window popup and then dissapear - but the osk stayed on the screen... I'll try it with a couple of other things to see if it will work. It works on my PC. I'm not sure if your windows account is administrator. Quote Link to comment
Saverio Posted December 22, 2011 Report Share Posted December 22, 2011 Just tried takskill on the osk within a cmd window and it doesn't like it for some reason (access is denied!) but it does work on other applications, so it should work for what I want to do. It's a security issue. See this thread for more information: 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.