Computing.Net > Forums > Programming > Cpu Fan Speed in Visual Basic 6.0

Cpu Fan Speed in Visual Basic 6.0

Reply to Message Icon

Original Message
Name: InFeRnOsKuLL
Date: October 28, 2004 at 05:53:06 Pacific
Subject: Cpu Fan Speed in Visual Basic 6.0
OS: Windows 98 se
CPU/Ram: pentium 2
Comment:

HELP!!!!....I want to learn how to make a program that recognizes the motherboard I'm running off of. After it does that I want the program to monitor the CPU fan speed....all in VB6...Any help along with the code would be VERY helpful...thank you.

WeLcOmE To ThE HeLL I CaLL My LiFe


Report Offensive Message For Removal


Response Number 1
Name: StuartS
Date: October 28, 2004 at 16:34:10 Pacific
Subject: Cpu Fan Speed in Visual Basic 6.0
Reply: (edit)

I don't think you are going to do that in VB. To get the fan speeds you are going to have to address BIOS hardware ports and you can't do that with VB.

The only way is to write a DLL in C++ and get at it that way.

Stuart


Report Offensive Follow Up For Removal

Response Number 2
Name: InFeRnOsKuLL
Date: October 29, 2004 at 06:46:57 Pacific
Subject: Cpu Fan Speed in Visual Basic 6.0
Reply: (edit)

Thank you Stuart, so if I use C++ to make a DLL, what would the code look like, I'm not too well with looking up ports...what command would I use to look up the port for the fan?

WeLcOmE To ThE HeLL I CaLL My LiFe


Report Offensive Follow Up For Removal

Response Number 3
Name: StuartS
Date: October 29, 2004 at 09:06:24 Pacific
Subject: Cpu Fan Speed in Visual Basic 6.0
Reply: (edit)

Its a while since I did any C++ programming but you would be using commands like

yy = inp xx

xx Being the port number you are looking for.

outp xx,yy

Would write the value yy, to port XX.

To find out which ports you need to are going to have to get hold of some BIOS documentation. It is available on the Internet if you search Goggle.

Basically with the BIOS, you output a value to a particular port which tells the BIOS what value you are looking for, you then read the vale on another port.

Stuart


Report Offensive Follow Up For Removal

Response Number 4
Name: elric
Date: October 31, 2004 at 08:23:17 Pacific
Subject: Cpu Fan Speed in Visual Basic 6.0
Reply: (edit)

G'day,

You could accomplish this using VB6, but you would require a third party DLL.
Stuart is correct; you would require a DLL file to allow access to any low level functions. There are, however, third party files that can be used with Visual Basic.
Try this link: www.lvr.com
There is a whole wealth of info there and a dll file (io.dll or winio.dll I forget which) that can be used with WIN16 and WIN32 operating systems.
Another useful link is www.windmill.co.uk which gives a different spin on using VBA(Excel and Access) as an IO tool.
Having said all that, I'm not sure how you would go about determining the fan speed. I have no knowledge in this area (but would be happy to learn)and just where the information is kept I don't know.
I doubt that you would need to read a hardware IO port because it would be part of the motherboard ASIC chip (just guessing)and would probably be available through a RAM address if anything. So, you might have to peek() or poke() some RAM locations to get the info.
I think most newer fans have a Tacho output, but where that info is kept I don't know.
Anyway, good luck with it all, and don't forget to let us know how you got on.
regards,
Elric


Report Offensive Follow Up For Removal

Response Number 5
Name: StuartS
Date: October 31, 2004 at 08:57:50 Pacific
Subject: Cpu Fan Speed in Visual Basic 6.0
Reply: (edit)

>> I think most newer fans have a Tacho output, but where that info is kept I don't know. <<

Its stored in the CMOS memory somewhere along with the RTC. It has to be otherwise if it was in main memory the OS would overwrite it when the OS booted. As the fan speed is active before the OS boots, it has to be in CMOS. The fan speeds is a function of the BIOS and Windows will not allow an external device to write directly to memory.

The following will point you in the right direction:

http://members.iweb.net.au/~pstorr/pcbook/book5/cmos.htm

Further research is required to find out exactly where in the 128 bytes of CMOS memory the information is stored.

Stuart


Report Offensive Follow Up For Removal


Response Number 6
Name: InFeRnOsKuLL
Date: November 1, 2004 at 08:42:24 Pacific
Subject: Cpu Fan Speed in Visual Basic 6.0
Reply: (edit)

Thank you, I shall start this tonight and see if I can get this thing to work!

WeLcOmE To ThE HeLL I CaLL My LiFe


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Cpu Fan Speed in Visual Basic 6.0

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge