Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Notebook temperature? (https://www.delphipraxis.net/97383-notebook-temperature.html)

Razor 9. Aug 2007 15:18


Notebook temperature?
 
Yes how to get temperature from a notebook i got a compaq evo n1005.And i would like to display temperature of cpu or any other temperature? :)

hathor 9. Aug 2007 16:55

Re: Notebook temperature?
 
Liste der Anhänge anzeigen (Anzahl: 1)
What is the name of the EC?

Razor 9. Aug 2007 17:01

Re: Notebook temperature?
 
It has got

-Northbrige=ATI Radeon IGP 320
-Southbrige=ALi M1533


speed fan report

SMBus base address : $8040
Linked ALI 1535D/D+ SMBUS at $8040
Scanning ISA BUS at $0290...
Scanning Ali SMBus at $8040...
ALi M1535 found on PCI
SMART Enabled for drive 0
Found TOSHIBA MK2018GAP (20,0GB)
Found ACPI temperature (55,0C)
End of detection
Loaded 0 events

hathor 9. Aug 2007 17:49

Re: Notebook temperature?
 
Here is a program for discovering some hardware secrets - it's called Read & Write Utility:

http://jacky5488.myweb.hinet.net/bin/RwV025.zip

Click the EC-Icon for reading the Embedded Controller - if the adresses 0066/0062 are wrong try 0064/0060.
Changing values in the grid are temperatures, fan speeds, voltages...

Razor 9. Aug 2007 18:41

Re: Notebook temperature?
 
tool freezes when i click on em embeded controler... :(

hathor 9. Aug 2007 19:01

Re: Notebook temperature?
 
If the window Embedded Controller is open click REFRESH - change it to 5sec.

Razor 9. Aug 2007 20:08

Re: Notebook temperature?
 
i dont want to read the temperature in that tool if its possible and how can i read it through delphi code,that refresh thing is crosed X.

hathor 9. Aug 2007 20:38

Re: Notebook temperature?
 
The REFRESH-Button is clickable!

Razor 9. Aug 2007 20:51

Re: Notebook temperature?
 
Dude how MANY times i have to say it it freezes my notebook when clicking at EC

Proof!
image snipped - Dany

If you want to help introduce other solution. :?

[edit=Admin]Large image removed - add it as an attachment please Mfg, Daniel[/edit]

hathor 9. Aug 2007 21:37

Re: Notebook temperature?
 
He Dude, how MANY times i have to say:
- if the adresses 0066/0062 are wrong try 0064/0060.

EC-Section in the
original RW.ini:
EcRamInterval=1000
EC_SC=102
EC_DATA=98
EC_AddressSpaceID=1

change it to:
EcRamInterval=5000
EC_SC=100
EC_DATA=96
EC_AddressSpaceID=1

I'm sure, You don't like experiments - Why do You want to program something?

Daniel G 9. Aug 2007 21:44

Re: Notebook temperature?
 
Relax folks, relax... ;)

Razor 9. Aug 2007 21:49

Re: Notebook temperature?
 
Yea no problemo Daniel,its just that i dont need to experiment i asked if someone knows or has tried to code cpu temperature that works on notebook? :-D

fLaSh11 10. Aug 2007 01:06

Re: Notebook temperature?
 
Zitat:

Zitat von Razor
how can i read it through delphi code

u could try to use Hier im Forum suchenWMI ; Bei Google suchenDelphi WMI.

Razor 10. Aug 2007 18:00

Re: Notebook temperature?
 
Okay..

-Where do i get EC(Embeded Controler)Name ?
-How can i if its even possible to change notebook's fan speed,its in bios and it changes with temperature and cpu usage.

Razor 13. Aug 2007 16:14

Re: Notebook temperature?
 
Now the thing is that this wont work on my motherboard i get error that it isnt supported,but i have a question can it work on notebooks?

I found this info on www.delphi-forum.de


Delphi-Quellcode:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,WbemScripting_TLB,activex, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    procedure WMIdata(Sender: TObject);
    function GetWMIstring2 (wmiHost, wmiClass, wmiProperty : string):string;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
function TForm1.GetWMIstring2 (wmiHost, wmiClass, wmiProperty : string):string;
var // These are all needed for the WMI querying process
  Locator: ISWbemLocator;
  Services: ISWbemServices;
  SObject: ISWbemObject;
  ObjSet:  ISWbemObjectSet;
  SProp:   ISWbemProperty;
  Enum:    IEnumVariant;
  Value:   Cardinal;
  TempObj: OleVariant;
  SN: string;
begin
  try
  Locator := CoSWbemLocator.Create;
   Services := Locator.ConnectServer(wmiHost, 'root\wmi', '', '', '','', 0, nil);
  ObjSet := Services.ExecQuery('SELECT * FROM '+wmiClass, 'WQL',
    wbemFlagReturnImmediately and wbemFlagForwardOnly , nil);
  Enum := (ObjSet._NewEnum) as IEnumVariant;
  while (Enum.Next(1, TempObj, Value) = S_OK) do
  begin
    SObject := IUnknown(tempObj) as ISWBemObject;
    SProp := SObject.Properties_.Item(wmiProperty, 0);
    if VarIsNull(SProp.Get_Value) then
      result := ''
    else
    begin
      SN := SProp.Get_Value;
      result := SN;
    end;
  end;
  except
   on exception do
    result := '';
   end;
end;
 procedure TForm1.WMIdata(Sender: TObject);
var tmpstr : string;  cputemp : Integer;
begin
tmpstr := getWMIstring2('','MSAcpi_ThermalZoneTemperature','CurrentTemperature');
  if tmpstr <> '' then
  Begin
    cputemp:= (StrToInt(tmpstr) - 2732) div 10;
    form1.caption := IntToStr(cputemp) + ' °C'
  end else
   form1.Caption := 'ERROR';
end;

procedure TForm1.Button1Click(Sender: TObject);
var tmpstr : string;  cputemp : Integer;
begin
tmpstr := getWMIstring2('','MSAcpi_ThermalZoneTemperature','CurrentTemperature');
  if tmpstr <> '' then
  Begin
    cputemp:= (StrToInt(tmpstr) - 2732) div 10;
    form1.caption := IntToStr(cputemp) + ' °C'
  end else
   form1.Caption := 'ERROR';
end;
end.


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:34 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz