z999 Posted June 6, 2008 Share Posted June 6, 2008 Hi, My computer is starting to get hot again so to verify it I want to make a script that will take the CPU sensor data every 30 sec/1 min and put it in a CSV. I know how to do everything except how to get the CPU temp. I did a search and the best I could find was CompInfo that didn't have temperature measurement in it. Can someone point me to the direction where to look for? Link to comment Share on other sites More sharing options...
Bert Posted June 6, 2008 Share Posted June 6, 2008 In doing a little research, it depends on your motherboard. Who makes it? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Bert Posted June 6, 2008 Share Posted June 6, 2008 http://tamaru.homeip.net/~shingo/mobilemet...eterreadme1.htm The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
z999 Posted June 7, 2008 Author Share Posted June 7, 2008 My motherboard is an ASUS P4S800 w/ a intel P4 (presscot based). can this app export a log file? I need to check the CPU under long idles and extreme conditions to be able to check it w/ excel (graphs and co.) Link to comment Share on other sites More sharing options...
James Posted June 7, 2008 Share Posted June 7, 2008 I can't seem to translate any VBS code to AU3. Func CPUTemp($sComputer = ".") Local $Obj, $Item, $Items $Obj = ObjGet("winmgmts:\\" & $sComputer & "\root\WMI") $OEvent=ObjEvent("AutoIt.Error","nothing") If IsObj($Obj) Then ConsoleWrite("+> Item is object!") $Item = $Obj.ExecQuery("SELECT * FROM MSAcpi_ThermalZoneTemperature") For $Items in $Item ConsoleWrite("Current Temperature: " & $Items.CurrentTemperature) ConsoleWrite("Critical Trip Point: " & $Items.CriticalTripPoint) Next EndIf EndFunc #cs strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI") Set colItems = objWMIService.ExecQuery( _ "SELECT * FROM MSAcpi_ThermalZoneTemperature",,48) For Each objItem in colItems Wscript.Echo "-----------------------------------" Wscript.Echo "MSAcpi_ThermalZoneTemperature instance" Wscript.Echo "-----------------------------------" Wscript.Echo "CurrentTemperature: " & objItem.CurrentTemperature Wscript.Echo "CurrentTemperature: " & objItem.CriticalTripPoint Wscript.Echo "CurrentTemperature: " & objItem.ThermalStamp Next #ce The object never works though :hmm: Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
ChrisL Posted June 7, 2008 Share Posted June 7, 2008 I can't seem to translate any VBS code to AU3. Func CPUTemp($sComputer = ".") Local $Obj, $Item, $Items $Obj = ObjGet("winmgmts:\\" & $sComputer & "\root\WMI") $OEvent=ObjEvent("AutoIt.Error","nothing") If IsObj($Obj) Then ConsoleWrite("+> Item is object!") $Item = $Obj.ExecQuery("SELECT * FROM MSAcpi_ThermalZoneTemperature") For $Items in $Item ConsoleWrite("Current Temperature: " & $Items.CurrentTemperature) ConsoleWrite("Critical Trip Point: " & $Items.CriticalTripPoint) Next EndIf EndFunc #cs strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI") Set colItems = objWMIService.ExecQuery( _ "SELECT * FROM MSAcpi_ThermalZoneTemperature",,48) For Each objItem in colItems Wscript.Echo "-----------------------------------" Wscript.Echo "MSAcpi_ThermalZoneTemperature instance" Wscript.Echo "-----------------------------------" Wscript.Echo "CurrentTemperature: " & objItem.CurrentTemperature Wscript.Echo "CurrentTemperature: " & objItem.CriticalTripPoint Wscript.Echo "CurrentTemperature: " & objItem.ThermalStamp Next #ce The object never works though :hmm: Your mother board probably doesn't support the Acpi_ThermalZoneTemperature. This code works for me $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $strComputer = "." $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\wmi") $Instances = $objWMIService.InstancesOf("MSAcpi_ThermalZoneTemperature") For $Item in $Instances Msgbox(0,"",($Item.CurrentTemperature - 2732) / 10 & "c") Next But it is not the same reading as the previously mentioned application, however I don't think it is reffering to the CPU temp [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
ChrisL Posted June 7, 2008 Share Posted June 7, 2008 Or expandcollapse popup$wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $strComputer = "." $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\wmi") $colItems = $objWMIService.ExecQuery( "SELECT * FROM MSAcpi_ThermalZoneTemperature", "WQL",$wbemFlagReturnImmediately + $wbemFlagForwardOnly) $Instances = $objWMIService.InstancesOf("MSAcpi_ThermalZoneTemperature") $Output="" For $objItem in $colItems $Output&= "-----------------------------------" & @crlf $Output&= "MSAcpi_ThermalZoneTemperature instance" & @crlf $Output&= "-----------------------------------" & @crlf $Output&= "Active: " & $objItem.Active & @crlf If ($objItem.ActiveTripPoint) = 0 Then $Output&= "ActiveTripPoint: " & @crlf Else $a = $objItem.ActiveTripPoint $Output&= "ActiveTripPoint: "; & Join($objItem.ActiveTripPoint, ",") & @crlf For $i = 0 to Ubound($a) -1 $Output&= $a[$i] & "," Next If StringRight($Output,1) = "," then $Output = StringTrimRight($Output,1) $Output &= @crlf EndIf $Output&= "ActiveTripPointCount: " & $objItem.ActiveTripPointCount & @crlf $Output&= "CriticalTripPoint Raw: " & $objItem.CriticalTripPoint & @crlf $Output&= "CurrentTemperature Raw: " & $objItem.CurrentTemperature & @crlf $Output&= "InstanceName: " & $objItem.InstanceName & @crlf $Output&= "PassiveTripPoint: " & $objItem.PassiveTripPoint & @crlf $Output&= "Reserved: " & $objItem.Reserved & @crlf $Output&= "SamplingPeriod: " & $objItem.SamplingPeriod & @crlf $Output&= "ThermalConstant1: " & $objItem.ThermalConstant1 & @crlf $Output&= "ThermalConstant2: " & $objItem.ThermalConstant2 & @crlf $Output&= "ThermalStamp: " & $objItem.ThermalStamp & @crlf $CurrTemp=$objItem.CurrentTemperature $Critical = $objItem.CriticalTripPoint $Output&= "CriticalTemperature Centigrade: " & ($Critical - 2732) / 10 & @crlf $Output&= "CurrentTemperature Centigrade: " & ($CurrTemp - 2732) / 10 & @crlf $Output&= "CriticalTemperature Farenheit: " & ((9/5)*(($Critical - 2732)/10)) + 32 & @crlf $FarTemp=((9/5)*(($CurrTemp - 2732)/10)) + 32 $Output&= "CurrentTemperature Farenheit: " & $FarTemp & @crlf Next If $output = "" then Msgbox(0,"","No ACPI device found") Else Msgbox(0,"",$Output) EndIf FBSAutomation 1 [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
z999 Posted June 7, 2008 Author Share Posted June 7, 2008 How do I use this code? I don't get it... I need a function that I can call and will return an intenger w/ the current CPU temperature. Link to comment Share on other sites More sharing options...
ChrisL Posted June 7, 2008 Share Posted June 7, 2008 (edited) Msgbox(0,"",_ACPI_Temp() & "c") Func _ACPI_Temp() $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $CurrTemp = -1 $strComputer = "." $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\wmi") $colItems = $objWMIService.ExecQuery( "SELECT * FROM MSAcpi_ThermalZoneTemperature", "WQL",$wbemFlagReturnImmediately + $wbemFlagForwardOnly) For $objItem in $colItems $CurrTemp =($objItem.CurrentTemperature - 2732) / 10 ;$Critical = ($objItem.CriticalTripPoint - 2732) / 10 Next Return $CurrTemp EndFunc Edited June 7, 2008 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
z999 Posted June 7, 2008 Author Share Posted June 7, 2008 (edited) Thx, that's exactly what I was looking for. I'm gonna check it now. edit: BUT... that doesn't work, it returns -1. Edited June 7, 2008 by z999 Link to comment Share on other sites More sharing options...
ChrisL Posted June 7, 2008 Share Posted June 7, 2008 Thx, that's exactly what I was looking for. I'm gonna check it now.edit: BUT... that doesn't work, it returns -1.Your motherboard doesn't support the MSAcpi_ThermalZoneTemperature then or WMI doesn't get the info [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 7, 2008 Share Posted June 7, 2008 Thx, that's exactly what I was looking for. I'm gonna check it now.edit: BUT... that doesn't work, it returns -1.That indicates your motherboard drivers do not provide an interface to those values. Some just don't, especially older ones. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Siao Posted June 7, 2008 Share Posted June 7, 2008 There are many tools providing such info out there, some of them free (HWMonitor and other from cpuid.com, SpeedFan, Asus Probe since you have Asus mobo, etc...) "be smart, drink your wine" Link to comment Share on other sites More sharing options...
z999 Posted June 7, 2008 Author Share Posted June 7, 2008 it isn't an old mb. it's supposed to be something like 2-3 y/o, how new does it need to be to support APCI? and I need a tool that is small and exports a log (over time), most of the apps just provide the current temp. Link to comment Share on other sites More sharing options...
GEOSoft Posted June 7, 2008 Share Posted June 7, 2008 WMI should get it as long as you are running Vista. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Siao Posted June 7, 2008 Share Posted June 7, 2008 most of the apps just provide the current temp.So? Auto It. "be smart, drink your wine" Link to comment Share on other sites More sharing options...
BinaryBrother Posted January 29, 2009 Share Posted January 29, 2009 I realize that this thread is a bit old... That script returned -1 for me as well, and my machine specs are... AMD Phenom Triple-Core processor 8400+ (2.0 GT/s Front-side Bus) 3GB PC2-6400 DDR2 (up-to 8 GB) 640GB 7200 rpm Serial ATA NVIDA GeForce 6150 SE Graphics with TurboCache (128MB Dedicated GM) ATI Radeon HD 4850 Dual-Head (512mb) Brand-spankin new Asus... (Asus M2N68-LA) Can't say mine is too old... Survey says! #RequireAdmin Worked like a charm... Too bad that guy might never know that... >.< P.S. I'm running Win7, so I'd assume this works on Vista as well, as the kernel is almost identical... Oh, and I will do my best to lay off the coffee... Xandy 1 SIGNATURE_0X800007D NOT FOUND Link to comment Share on other sites More sharing options...
RomanK Posted February 12, 2009 Share Posted February 12, 2009 I tried that with all the code posted, but for me it doesn't work at all. I am on 64 bit Win7 at the moment and my Motherboard is an MSI K9N Neo-F V3, was released about 2 years ago I believe. [font="Courier New"]http://RomanK.hondadesigns.com[/font] Link to comment Share on other sites More sharing options...
SEuBo Posted November 17, 2019 Share Posted November 17, 2019 sorry for replying so late, but this is one of the first google results. FYI: Codes work fine, just make sure to run script as admin. Cheers, AutoIt Examples/UDF's:Generate Function at Runtime using IRunningObjectTable / AutoItObjectVery Simple Inter-Process Communication (using AutoItObject Pure AutoIt) Link to comment Share on other sites More sharing options...
water Posted November 17, 2019 Share Posted November 17, 2019 "Late" is the understatement of the year The last post is > 10 years old and most of the posters have long left the forum. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now