Edward QU | 1 Jul 2012 11:18

Cannot get proper query CPU Temperature under win7-64bit

hello:
I Can't query CPU proper Temperature (MSAcpi_ThermalZoneTemperature) on
Windows 7  64 bit using wmi. The temperature I got is the mother
board's.

The laptop is ASUS UX21e,Intel® Core™ i7 2677M Processor,Genuine
Windows® 7 Professional 64bit,Intel® QS67 Express Chipset.

The program is as the following:
require 'win32ole'

  wmi = WIN32OLE.connect("winmgmts://./root/wmi")
  qry = wmi.execquery("select * from MSAcpi_ThermalZoneTemperature" )
  qry.each { |i|
      $now_temp_k= i.send("CurrentTemperature")
      $now_temp_c=($now_temp_k - 2732) / 10
      $critical_temp_k= i.send("CriticalTripPoint")
      $critical_temp_c=($critical_temp_k - 2732) / 10
      }
   puts "Current CPU Temperature: #{$now_temp_c} Centigrade ,Critical
Trip Point is #{$critical_temp_c} Centigrade."

Any help would be appreciated!

Regards
Edward

--

-- 
Posted via http://www.ruby-forum.com/.

(Continue reading)

Jam | 1 Jul 2012 15:12
Favicon
Gravatar

Re: Cannot get proper query CPU Temperature under win7-64bit


On Jul 1, 2012, at 3:18 AM, Edward QU <lists <at> ruby-forum.com> wrote:

> hello:
> I Can't query CPU proper Temperature (MSAcpi_ThermalZoneTemperature) on
> Windows 7  64 bit using wmi. The temperature I got is the mother
> board's.
> 
> The laptop is ASUS UX21e,Intel® Core™ i7 2677M Processor,Genuine
> Windows® 7 Professional 64bit,Intel® QS67 Express Chipset.
> 
> The program is as the following:
> require 'win32ole'
> 
>  wmi = WIN32OLE.connect("winmgmts://./root/wmi")
>  qry = wmi.execquery("select * from MSAcpi_ThermalZoneTemperature" )
>  qry.each { |i|
>      $now_temp_k= i.send("CurrentTemperature")
>      $now_temp_c=($now_temp_k - 2732) / 10
>      $critical_temp_k= i.send("CriticalTripPoint")
>      $critical_temp_c=($critical_temp_k - 2732) / 10
>      }
>   puts "Current CPU Temperature: #{$now_temp_c} Centigrade ,Critical
> Trip Point is #{$critical_temp_c} Centigrade."
> 
> Any help would be appreciated!
> 
> Regards
> Edward

(Continue reading)

Edward QU | 2 Jul 2012 16:58

Re: Cannot get proper query CPU Temperature under win7-64bit

Thank you Jams. Let me check the specification of wmi and motherboard 
Manuel.

--

-- 
Posted via http://www.ruby-forum.com/.


Gmane