Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CPU temp, fan speed, voltage monitoring?

745 views
Skip to first unread message

norberto

unread,
Oct 26, 2007, 3:05:27 PM10/26/07
to
Hi,

Does anyone know how to read sensor values on the motherboard, such as CPU
temperature, fan speed(s) and the various voltages? These values are typically
displayed in the BIOS but i would like to access them via Delphi so that i can
display them in my application.

i've searched on the web but have only found existing utilities and no code
examples or components.

Can anyone suggest example code or components to do this?

Thanks in advance for any help.

norberto

unread,
Oct 27, 2007, 1:15:23 AM10/27/07
to
i have found that if the machine supports SMBIOS then all this information is
already there in a standardized format.

My next question is: how do i access the SMBIOS information? Is there any Delphi
component, DLL or other code available? Does anyone know how to do this or
what's involved?

Thanks.

DJSox

unread,
Oct 27, 2007, 1:31:59 AM10/27/07
to
It looks like you use WMI, try this link

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=628&lngWId=7Dan"norberto" <pell...@shaw.ca> wrote in messagenews:4722...@newsgroups.borland.com...>i have found that if the machine supports SMBIOS then all this informationis already there in a standardized format.>> My next question is: how do i access the SMBIOS information? Is there anyDelphi component, DLL or other code available? Does anyone know how to dothis or what's involved?>> Thanks.

norberto

unread,
Oct 27, 2007, 1:40:28 AM10/27/07
to
DJSox wrote:
> It looks like you use WMI, try this link
>
> http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=628&lngWId=7Dan"norberto" <pell...@shaw.ca> wrote in messagenews:4722...@newsgroups.borland.com...>i have found that if the machine supports SMBIOS then all this informationis already there in a standardized format.>> My next question is: how do i access the SMBIOS information? Is there anyDelphi component, DLL or other code available? Does anyone know how to dothis or what's involved?>> Thanks.
>

Thanks. i have looked at WMI and there seem to be a couple of problems with it.
First, it only has provision (currently) to read the CPU temperature and not any
other hardware sensor parameters. Second, i've seen postings on WMI groups that
state that they have never seen the CPU Temperature WMI call actually return a
value. It doesn't seem to work at all, which is odd.

i'm thinking that the way to do this may be through SMBIOS, since it is a
standard and it does have a table (#26) that contains all the data, including
CPU Temp, fan speeds, and various system voltages which are monitored.

i'm not sure if reading the SMBIOS Table 26 repeatedly can give "real time"
snapshots of the sensors, but i'd like to try. Except that i don't have a clue
how to access the SMBIOS via Delphi.

So close yet so far...

norberto

unread,
Oct 27, 2007, 2:14:19 AM10/27/07
to
DJSox wrote:
> It looks like you use WMI, try this link
>
> http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=628&lngWId=7Dan"norberto" <pell...@shaw.ca> wrote in messagenews:4722...@newsgroups.borland.com...>i have found that if the machine supports SMBIOS then all this informationis already there in a standardized format.>> My next question is: how do i access the SMBIOS information? Is there anyDelphi component, DLL or other code available? Does anyone know how to dothis or what's involved?>> Thanks.
>

Actually, i just found a link and i had some severe misinterpretations of the
data i had found thus far. Here is a link:

http://www.codeguru.com/cpp/misc/samples/systeminformation/article.php/c12347/#Retrieval

SMBIOS is part of Windows and can be accessed either via WMI in
MSSMBios_RawSMBiosTables class inside the root\wmi namespace or through the
EnumSystemFirmwareTables and GetSystemFirmwareTable APIs.

So, in narrowing this down, my next question is: how to do either of these in
Delphi?

Jorge Almeida

unread,
Oct 27, 2007, 4:00:41 AM10/27/07
to
norberto wrote:

> i have found that if the machine supports SMBIOS then all this information is already there in a standardized format.

Are you sure? Where did you found that?

From: http://www.microsoft.com/whdc/system/platform/firmware/SMBIOS.mspx

"Windows relieves programs of the need to scan physical memory for SMBIOS table data by automatically retrieving SMBIOS data at system startup and then making it available to programs. SMBIOS data is available through Windows Management Instrumentation (WMI) classes and through the Microsoft Win32® application programming interface (API)."

When I looked at this 2 months last, I did not find information to support more than read once "at system startup". I think not good to check CPU temperature, but good to interrogate what hardware devices present?

--
Jorge

norberto

unread,
Oct 27, 2007, 1:56:36 PM10/27/07
to
Jorge Almeida wrote:
> norberto wrote:
>
>> i have found that if the machine supports SMBIOS then all this information
>> is already there in a standardized format.
>
> Are you sure? Where did you found that?


http://www.dmtf.org/standards/smbios/


>
> From: http://www.microsoft.com/whdc/system/platform/firmware/SMBIOS.mspx
>
> "Windows relieves programs of the need to scan physical memory for SMBIOS
> table data by automatically retrieving SMBIOS data at system startup and then
> making it available to programs. SMBIOS data is available through Windows
> Management Instrumentation (WMI) classes and through the Microsoft Win32®
> application programming interface (API)."
>
> When I looked at this 2 months last, I did not find information to support
> more than read once "at system startup". I think not good to check CPU
> temperature, but good to interrogate what hardware devices present?
>

If using the WMI then i think you are correct. It seems to be loaded once at
startup and would therefore be only a snapshot of the main parameters for the
system hardware. However, there are a couple of APIs available. To quote MS:

http://msdn2.microsoft.com/en-us/library/ms724379.aspx

"As of Windows Server 2003 SP1, applications cannot access the
\Device\PhysicalMemory object. Access to this object is limited to kernel-mode
drivers. This change affects applications read System Management BIOS (SMBIOS)
or other BIOS data stored in the lowest 1MB of physical memory. Applications
have the following alternatives to read data from low physical memory:

* Retrieve the SMBIOS properties using WMI. Many individual properties are
contained in the Win32 classes. You can also retrieve the raw SMBIOS data in a
single buffer using the MSSMBios_RawSMBiosTables class.

(////********* This is the key, i think: ******////:)
* Use the GetSystemFirmwareTable function to read the raw SMBIOS firmware
table.

There is no way for applications to write to low physical memory."

Assuming that the BIOS is still retrieving the CPU temp, fan speeds and voltages
information even while Windows is running (and this is a big assumption,
hopefully correct), then i think it is possible as long as the APIs
GetSystemFirmwareTable and EnumSystemFirmwareTables can be made available in
Delphi. i'd like to try instead of writing a specialized kernel-mode driver /
DLL that will read the data in question for various chipsets (not something
pleasant to consider since hardware keeps changing on a daily basis).

i have no idea how to do any of this. i know that the more experienced Delphi
programmers have implemented other MS APIs. Is there anyone that can code these
APIs or if someone can tell me how to do it, then maybe i can give it a try?

Thanks again.

0 new messages