11-11-2010 02:25 PM
I am trying to programmatically monitor when a labview executable app freezes. So, I was thinking that I could have another executable that monitors that apps CPU usage - when it stops oscillating - it would detect a freeze. Currently I can see when it freezes by looking at the processes tab in the Windows 7 task manager. Does anyone know a way to monitor this value programmatically? Maybe there is a more elegant way to determine when a program freezes than CPU usage? Someone suggested previously having the main app write to a file each minute and then the watching app checks in on that file - I was hoping to find a simpler way.
Thanks.
11-12-2010 09:44 AM
Personally, I think your alternative is the easier solution. Basically have your main app output some kind of "heartbeat" signal like a constantly updating timestamp. It could be outputed to a simple txt file, or you could just output it to a front panel indicator, and then have your "watchdog" app check the value using VI Server.
I don't know how to check CPU usage, but I am guessing you could use some .NET calls to this namespace:
http://msdn.microsoft.com/en-us/library/system.diagnostics.aspx