LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you access the individual CPU usage of a program? I am looking for the program to freeze...

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.

0 Kudos
Message 1 of 2
(2,448 Views)

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

 

http://www.medicollector.com
0 Kudos
Message 2 of 2
(2,419 Views)