How refresh the ACPI thermal zone temperature?

H

Harald

Hello,

I want to write a utility which allow me to read the CPU temperature. My
notebook is an old ThinkPad 600X (PIII 650 MHz) and is ACPI compliant.

I use WMI and the class MSAcpi_ThermalZoneTemperature . Please see my VBS:

strComputer = "."
wmiNS = "\root\wmi"
wmiQuery = "Select * from MSAcpi_ThermalZoneTemperature"

Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objLocator.ConnectServer(strComputer, wmiNS)
Set colItems = objWMIService.ExecQuery(wmiQuery)
For Each objItem in colItems
With objItem
wscript.echo "CurrentTemperature: " & .CurrentTemperature
wscript.echo "InstanceName: " & .InstanceName
wscript.echo " "
End With
Next

It works but it does not refresh the temperature. I get always the same
temperature. Only after Reboot I get other values.

Is there a way to force WMI to refresh the ACPI data?

Thanks for your help!

Harald
 
V

VanguardLH

in
Hello,

I want to write a utility which allow me to read the CPU temperature. My
notebook is an old ThinkPad 600X (PIII 650 MHz) and is ACPI compliant.

I use WMI and the class MSAcpi_ThermalZoneTemperature . Please see my VBS:

strComputer = "."
wmiNS = "\root\wmi"
wmiQuery = "Select * from MSAcpi_ThermalZoneTemperature"

Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objLocator.ConnectServer(strComputer, wmiNS)
Set colItems = objWMIService.ExecQuery(wmiQuery)
For Each objItem in colItems
With objItem
wscript.echo "CurrentTemperature: " & .CurrentTemperature
wscript.echo "InstanceName: " & .InstanceName
wscript.echo " "
End With
Next

It works but it does not refresh the temperature. I get always the same
temperature. Only after Reboot I get other values.

Is there a way to force WMI to refresh the ACPI data?

Thanks for your help!

Harald

Guess I missed the part of the name of this newsgroup that says it deals
with programming issues.

See: microsoft.public.vb.*

Where is the refresh method, like on the whatever panel uses this code?
How about the DoEvents on the app? I'm sure the VB newsgroups can
answer how to refresh your panel and when to do so but you might want to
provide more context than this code snippet.
 
H

Harald

Hello,

it does not work with the Refresh method and the DoEvents. It is much more
complex. I searched in the web for hours, and I find only people with the
same problem, but no ansers.

Maybe I post the question also in the developer forum.

Thanks

Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top