I am working on part of a script to calculate the dewpoint, both outside and inside the house. the formula is rather complex and always seems to return back a value much lower than say an online dewpoint calculater etc..
does VBscript have trouble handling exponents or complex numbers? ive tried relocating the paranthesis to see if I could change the order of manipulation but still cant get a good reading..
I use this as a means to determine whether my outside air intake is open or closed and also to determine the blower speed control on my air-conditioner. on super humid days (dewpoint 69 and above) its better to allow longer cooling cycles, move less air across the coil making the air colder as it will pull more humidity.. I attached the script below possibly someonecan help me out.
grabbing dewpoint from an XML feed is not an option here as my house typically has different humidity and temp readings than the NWS site.. plus I cant monitor interior dewpoints through that method.
-christopher
does VBscript have trouble handling exponents or complex numbers? ive tried relocating the paranthesis to see if I could change the order of manipulation but still cant get a good reading..
I use this as a means to determine whether my outside air intake is open or closed and also to determine the blower speed control on my air-conditioner. on super humid days (dewpoint 69 and above) its better to allow longer cooling cycles, move less air across the coil making the air colder as it will pull more humidity.. I attached the script below possibly someonecan help me out.
grabbing dewpoint from an XML feed is not an option here as my house typically has different humidity and temp readings than the NWS site.. plus I cant monitor interior dewpoints through that method.
-christopher
PHP Code:
sub main()
'***************************************
'* Script to Calculate Indoor Dewpoint *
'***************************************
dim tempf
dim tempc
dim rh
dim dewpointc
dim tdewpointc
dim dewpointf
dim x
tempf=cint(hs.devicevalue("^11")) 'Return air duct temp bobcat
msgbox tempf
tempc=cint((5/9)*(tempf-32))
rh=cint(hs.devicevalue("^8")) 'relative humidity from bobcat
msgbox rh
es=6.11*10^(7.5*tempc/(237.7+tempc))
E=(rh*Es)/100
tdewpointc=(-430.22+237.7*log(E))/(-log(E)+19.08)
dewpointf=cint((9/5)*tdewpointc+32)
msgbox dewpointf
end sub
Comment