How to get fan properties?
-
I wish to find a general method for retriving fan's properties such as speed as well as CPU temperature, how could I go about doing it? I tried to use win32_fan but it doesn't give me back anything.
Please post some sample code for how you used Win32_Fan. It's also possible that your drivers don't expose data correctly for the WMI class to view. You need to be sure your motherboard drivers are installed correctly and that they even expose the data you want. If they don't, there may be no practical way of getting it, short of knowing the details specs for the fan and writing assembler to get such information. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog]
-
Please post some sample code for how you used Win32_Fan. It's also possible that your drivers don't expose data correctly for the WMI class to view. You need to be sure your motherboard drivers are installed correctly and that they even expose the data you want. If they don't, there may be no practical way of getting it, short of knowing the details specs for the fan and writing assembler to get such information. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog]
This is the coding I used... I work fine for other properties such as processor though. ManagementObjectSearcher Fan = new ManagementObjectSearcher("Select * from Win32_Fan"); foreach(ManagementObject item in Fan.Get()) { Text.WriteLine(" {0} ",item.GetPropertyValue("ActiveCooling")); Text.WriteLine(" {0} ",item.GetPropertyValue("Description")); Text.WriteLine(" {0} ",item.GetPropertyValue("DeviceID")); Text.WriteLine(" {0} ",item.GetPropertyValue("Name")); Text.WriteLine(" {0} ",item.GetPropertyValue("Status")); Text.WriteLine(" {0} ",item.GetPropertyValue("VariableSpeed")); Text.WriteLine(""); }
-
This is the coding I used... I work fine for other properties such as processor though. ManagementObjectSearcher Fan = new ManagementObjectSearcher("Select * from Win32_Fan"); foreach(ManagementObject item in Fan.Get()) { Text.WriteLine(" {0} ",item.GetPropertyValue("ActiveCooling")); Text.WriteLine(" {0} ",item.GetPropertyValue("Description")); Text.WriteLine(" {0} ",item.GetPropertyValue("DeviceID")); Text.WriteLine(" {0} ",item.GetPropertyValue("Name")); Text.WriteLine(" {0} ",item.GetPropertyValue("Status")); Text.WriteLine(" {0} ",item.GetPropertyValue("VariableSpeed")); Text.WriteLine(""); }
When you step through (debug) your code, do you get any results with
Fan.Get()
? If not, then the problem is as I suspect: information about your CPU fan is not available. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog] -
When you step through (debug) your code, do you get any results with
Fan.Get()
? If not, then the problem is as I suspect: information about your CPU fan is not available. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog]I didn't get anything... I had tried with some other freeware program too but it didn't come up, perhaps it is like you said that the information is not available, however I had tried with several other computer and it didn't come up.... should I do programming on bios level or something like that? Thank yah,
-
I didn't get anything... I had tried with some other freeware program too but it didn't come up, perhaps it is like you said that the information is not available, however I had tried with several other computer and it didn't come up.... should I do programming on bios level or something like that? Thank yah,
That may not help. The fan itself just may not provide any sort of metrics. I recommend you crack open the case, remove the fan carefully if necessary, and get any information off of it you can - like make, model, etc. See if you can find any hardware specs for it on the manufacturer's site before you start with low-level programming that 1) can be complicated, and 2) really isn't a job for .NET at this point. Sure, you could P/Invoke lots of APIs and define lots of structs and enums for interop, but 1) it would be specific to your fan (otherwise the Win32_Fan WMI class would probably give you what you need), and 2) may not work anyway because the fan itself doesn't provide metrics. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog]
-
That may not help. The fan itself just may not provide any sort of metrics. I recommend you crack open the case, remove the fan carefully if necessary, and get any information off of it you can - like make, model, etc. See if you can find any hardware specs for it on the manufacturer's site before you start with low-level programming that 1) can be complicated, and 2) really isn't a job for .NET at this point. Sure, you could P/Invoke lots of APIs and define lots of structs and enums for interop, but 1) it would be specific to your fan (otherwise the Win32_Fan WMI class would probably give you what you need), and 2) may not work anyway because the fan itself doesn't provide metrics. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog]
-
Thank a lot for your help... Too bad that I am using a laptop and doesn't want to mess around with cracking it too much, I am really bad at assemble things back. Thank you,
Ah, if it's a laptop I wouldn't recommend it. Most desktops are easy to open, often times with just the click of a button. Sorry. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Customer Product-lifecycle Experience Microsoft [My Articles] [My Blog]