Rationale:

I decide to write this script directly to save my ears ;-). Why ?
Recently I refresh my home PC hw. XP2500+ CPU was easily overclocked to 2.4G 
real clock, but as You can guess it was possible at higher power dissipation. So
bigger fan was needed. Bigger fan means bigger noise. In the mean time I 
discover that PLC I/O on my new MoBo (Abit NF7) is based on Winbond 83627 
silicon. This baby has two PWM outs - so direct question arise: was boys form 
Abit clever enough to use it for fans speed control ?. Well - they was. 
So using those PWMs to automatic control of CPU and CASE fans was direct reason to write 
this script.




Supported hardware:

This script was tested with Winbond W83627 chip and AbitNF7 mainboard. However
Winbond is known to be register compatible within whole LPC family. So if You 
have W83781D W83782D W83977TF W83697HF - it should proper work at least for 
monitor functions (reading temp and fans speed). LM78 probably will work too.

Controlling fans is another story. Your MoBo has to support controlling fans 
voltage on fans MoBo sockets via I/O LPC PWM outs. 
If MoBo designer was clever enough - it should be done. Abit is known 
rather as HQ vendor so I can suspect that others Abit's MoBos with Winbond LPC 
I/O will have this feature as well. 

LM78 is not tested. I don't know: has LM78 PWM outs or not. It is simple to 
check with chip datasheet. 
If somebody has MoBo with LM78 - it is welcomed to test and adjust this script 
to LM78 hardware....   




What You need:

1. Martin Lafayette REXX gauge widgets lib. You can
find widgets library at "http://lafaix.online.fr/wpi/wgts-0-5-2.wpi"

2. rxPortIO lib. Required DLL is in archive. Full library You can find on 
Hobbes or at "http://home.att.net/~ASchw"

3. StHealth.dll lib. Required DLL is in archive. Full library You can find on 
Hobbes or at "http://www.nord-com.net/s.milcke/hwmon_en.htm"



Quick Start:

Remember: This script is accessing hardware registers of MoBo. 
You are doing this at Your own risk !

1. If You don't want to use Xcenter, set variable "SupportXcenterWidgets" to 0 
in "FansControl.cmd" and in "Watchdog.cmd".

2. If You use Xcenter - add two Martin Lafayette REXX gauge widgets. As a body 
script in widgets put "ShowCpuFanDetails.wgt" and "ShowCaseFanDetails.wgt" 

3. If You don't want WatchDog functionality, set variable SupportWatchdog to 0 
in "FansControl.cmd".

4. Simply launch FansControl.cmd script and see what happens.   

5. If You use Wathdog launch also WatchDog.cmd


How it works:

Script every 5 sec is reading CPU temp. Current CPU temp is compared with Hi and
Lo levels. If CPU temp is below Lo - then FAN power is set to 0%. 
CPU temp equal or above Hi gives FAN power = 100%. For CPU temp between Hi and 
Lo levels - fan power is counted proportionally.

Percentage Fan power is then recalculated to PWM values. Recalculation is done
by dirty "if % then value" way, because on My Abit NF7 function PWM->FanRPM is 
more exponential than linear (well, PWM as D/A is badly designed here...). 
I was decide to experimentally estimate this function and make multipoint 
linear interpolation.

When script has PWM values, they are written to w83627 chip. Short beep is
produced, when CPU Fan speed is programmed to different level.

If Xcenter is used, script is working with Xcenter in client-server model.
Script is putting current temp, percentage and RPM values into private RXQUEUEs.
Xcenter widgets are reading those queues every 1 sec and displaying 
them on Xcenter. 
I was forced to use client-server model, because Xcenter has some kind of 
bug: putting whole script in GAUGE is working, but after few hours, gauge 
widget randmly freezes.

If Watchdog is used, script is putting "Alive" string into private queue. 
Another script: "Watchdog.cmd" is reading this queue. If during 12 sec no 
Alive string arrives form main script - Watchdog.cmd script starts beeping.


That's all.
Happy computing!



