Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Read CPU temp

Read CPU temp

Scheduled Pinned Locked Moved C / C++ / MFC
csshardwarejsonquestion
8 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VeganFanatic
    wrote on last edited by
    #1

    I was looking for a code snippet to read the temperature of a CPU. I have a project that trashes the machine and watching the CPU temp seems prudent. I speculate there is a Winbond chip integrated into the motherboard. So the is obviously direct calls to the chip. Perhaps there is an API I can call? Direct reading of the hardware is less desirable than an API as the chip may not be the same in all machines.

    http://www.contract-developer.tk

    C L R 3 Replies Last reply
    0
    • V VeganFanatic

      I was looking for a code snippet to read the temperature of a CPU. I have a project that trashes the machine and watching the CPU temp seems prudent. I speculate there is a Winbond chip integrated into the motherboard. So the is obviously direct calls to the chip. Perhaps there is an API I can call? Direct reading of the hardware is less desirable than an API as the chip may not be the same in all machines.

      http://www.contract-developer.tk

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      I personally doubt there is a common API to perform what you want, if i were you i'd try to search for OpenSource motherboard/system monitoring software (e.g. on SourceForge[^]) and study it to learn how they are doing it, it's probably not simple if you want to provide support for multiple systems. If you DO find such an API do tell us, please, good luck.

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

      V 1 Reply Last reply
      0
      • V VeganFanatic

        I was looking for a code snippet to read the temperature of a CPU. I have a project that trashes the machine and watching the CPU temp seems prudent. I speculate there is a Winbond chip integrated into the motherboard. So the is obviously direct calls to the chip. Perhaps there is an API I can call? Direct reading of the hardware is less desirable than an API as the chip may not be the same in all machines.

        http://www.contract-developer.tk

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        I looked through the WMI classes and didn't find anything relevant. :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

        Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

        1 Reply Last reply
        0
        • C Code o mat

          I personally doubt there is a common API to perform what you want, if i were you i'd try to search for OpenSource motherboard/system monitoring software (e.g. on SourceForge[^]) and study it to learn how they are doing it, it's probably not simple if you want to provide support for multiple systems. If you DO find such an API do tell us, please, good luck.

          > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

          V Offline
          V Offline
          VeganFanatic
          wrote on last edited by
          #4

          If needed I guess another template/class can act as an API. When in doubt, drop down to assembler. Then the whole machine is accessible.

          http://www.contract-developer.tk

          C 1 Reply Last reply
          0
          • V VeganFanatic

            If needed I guess another template/class can act as an API. When in doubt, drop down to assembler. Then the whole machine is accessible.

            http://www.contract-developer.tk

            C Offline
            C Offline
            Code o mat
            wrote on last edited by
            #5

            Assembler or not, different manufacturers give different ways to access such information, if any, even different versions of the same motherboard might give you different ways, sadly. I wonder if there is some kind of a standard for such an information that is just not ingegrated into Windows / no manufacturer really follows, or no such thing exists at all. I mean, graphic card manufacturers provide DirectX compatible drivers for their cards (they ought to, noone would buy their card if they wouldn't...), why not providing drivers for motherboards with such a compatibility...*sigh*, well, one can dream, can one not?

            > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

            V 1 Reply Last reply
            0
            • C Code o mat

              Assembler or not, different manufacturers give different ways to access such information, if any, even different versions of the same motherboard might give you different ways, sadly. I wonder if there is some kind of a standard for such an information that is just not ingegrated into Windows / no manufacturer really follows, or no such thing exists at all. I mean, graphic card manufacturers provide DirectX compatible drivers for their cards (they ought to, noone would buy their card if they wouldn't...), why not providing drivers for motherboards with such a compatibility...*sigh*, well, one can dream, can one not?

              > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

              V Offline
              V Offline
              VeganFanatic
              wrote on last edited by
              #6

              Looks like a glaring omission, as I have searched MSDN and found nothing, Google, no good and on Soureforge the stuff is specific to certain boards only. I guess I will have to ask users to watch the temps manually when using my benchmarks.

              http://www.contract-developer.tk

              C 1 Reply Last reply
              0
              • V VeganFanatic

                Looks like a glaring omission, as I have searched MSDN and found nothing, Google, no good and on Soureforge the stuff is specific to certain boards only. I guess I will have to ask users to watch the temps manually when using my benchmarks.

                http://www.contract-developer.tk

                C Offline
                C Offline
                Code o mat
                wrote on last edited by
                #7

                When i was googling for this temperature monitoring API thing i saw a link about using Motherboard Monitor to gain temperature information (Motherboard Monitor is a freeware app. that can give you temp and voltage informations afaik), maybe try googling for it, it could be an option, i think the google hit mentioned something about using shared memory to communicate with MBM, if you think, check it.

                > The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <

                1 Reply Last reply
                0
                • V VeganFanatic

                  I was looking for a code snippet to read the temperature of a CPU. I have a project that trashes the machine and watching the CPU temp seems prudent. I speculate there is a Winbond chip integrated into the motherboard. So the is obviously direct calls to the chip. Perhaps there is an API I can call? Direct reading of the hardware is less desirable than an API as the chip may not be the same in all machines.

                  http://www.contract-developer.tk

                  R Offline
                  R Offline
                  Rick York
                  wrote on last edited by
                  #8

                  You may want to have a look at this : http://en.wikipedia.org/wiki/System_Management_BIOS[^] It is the wikipedia page for the SMBIOS or System Management BIOS standard. Hopefully that has something of value. If nothing else, you have another term to search for. ;)

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups