LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System monitor counter

I'm trying to use system monitor activeX in order to control memory usage and CPU usage of my PC.
All activeX properties work fine except the most useful: counter.
I've attached the screen shot of my VI.
 
P.S. I think counter property is used to read wich counter to read?!
 
Thank you,
Paolo.
0 Kudos
Message 1 of 9
(6,588 Views)
You're probably referring to the "Counters" property, which is a collection of counters, as described in MSDN. To use this you can do something like this:



Note: You need to change the "Preferred Execution System" of the VI to "user interface" to get a VI that uses this ActiveX control to run. You can change this from the VI Properties (File->VI Properties, and then change to the "Execution" category). Interestingly enough, once the VI stops the control keeps running.


Message Edited by smercurio_fc on 05-02-2006 08:58 AM

Message 2 of 9
(6,584 Views)
Great! It's working!!! Smiley Happy
 
Thank you!!!!
Paolo.
 
0 Kudos
Message 3 of 9
(6,560 Views)
Simply Superb !
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 4 of 9
(6,444 Views)
Great work smercurio !
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 5 of 9
(6,436 Views)

Cool!  Anyone know the name of counter for memory usage?  How did you get the input reference to DISystemMonitor?

Yes I did go to MSDN, and after swimming in the links for awhile, I found some code for listing the counters... but wow, surely the typical name for a memory counter hasn't changed?

 

Thanks.

0 Kudos
Message 6 of 9
(5,685 Views)

The input is the ActiveX container on the front panel. Attached is the actual VI (LV 8.2). I know it works in XP, but it doesn't work in Windows 7. At least Windows 7 64-bit. Not sure about Windows 7 32-bit.

 

The syntax for the pathname is \\Computer\PerfObject(ParentInstance/ObjectInstance#InstanceIndex)\Counter. In my example "PerfObject" is "Process(*)" to show all processes, and "Counter" is the name of the counter, which is "% Processor Time". You can get the various performance objects from this page: http://technet.microsoft.com/en-us/library/cc783073%28WS.10%29.aspx. Once you select one of the performance objects you want then the right-hand pane will list the available counter names. As you'll note for the Memory object, there's lots of memory counters. 

 

 

Message 7 of 9
(5,676 Views)

Thanks!!!  This was interesting.  After trying various counters from Memory, TCP, Process, System, and Server, I couldn't find any which correlated with the "not enough memory" error associated with my TCP/IP connection.  Any ideas?  Do you think this is my Windows Message loop filling up?

0 Kudos
Message 8 of 9
(5,636 Views)

That's a different question, and we should stick to the separate thread you created for this.

0 Kudos
Message 9 of 9
(5,628 Views)