<%@ LANGUAGE="VBScript" %> <% Function ctok (C) ctok = C + 273.15 End Function Function vappress (ktemp) expo = 23.832241 - 5.02808*(log(ktemp)/log(10)) - 1.3816*10^-7 * 10^(11.334 - .0303998 * ktemp) expo = expo + 8.1328 * 10^-3 * 10^(3.49149 - 1302.8844/ktemp) - 2949.076/ktemp ' response.write("vappress ktemp=" & ktemp & " expo " & expo & "
") vappress = 10^(expo) End Function Function DewPoint(temp,rh) If rh<0 Then rh=0 Elseif rh>100 Then rh=100 End If If temp<0 Then temp=0 Elseif temp>40 Then temp=40 End If ktemp=ctok(temp) etemp=vappress(ktemp) edewp = etemp * (rh/100) ' ' start guessing for the Dewpoint ' estdewp = temp incr = 5 prevsign = 1 este = 100 nloop=0 Do While (abs(edewp - este)> .01) And nloop<100 nloop=nloop+1 kestdewp=ctok(estdewp) este=vappress(kestdewp) ' response.write(" loop " & CStr(nloop) & " este= " & CDbl(este) & " edewp= " & CDbl(estdewp) & "
") If estecursign Then prevsign = cursign incr = incr * .5 End If estdewp = estdewp - incr * cursign Loop DewPoint = estdewp End Function %> <% If Not IsEmpty(request.form("Close")) Then %> <% End If timedate=Request("timedate") Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd If timedate="" Or IsEmpty(request.form("Selected_Time")) Then SQLStmt = " select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS') timedate from dual " Set RS = Connection.Execute(SQLStmt) timedate = CStr(RS("timedate")) Set RS=nothing End If If Not IsDate(timedate) Then message="Wrong Time/Date format " & timedate %> <% End If timedate_par=replace(timedate," ","%20") %> Tunnel Environment
               
<% SQLStmt = " select to_char(logdate,'MM/DD/YYYY HH24:MI:SS') ddate, " SQLStmt = SQLStmt & " 24*60*(to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-logdate) ddif, " SQLStmt = SQLStmt & " to_char(temperature,'90.0') ctemp,to_char(humidity,'90') chumid, " SQLStmt = SQLStmt & " temperature,humidity " SQLStmt = SQLStmt & " from phoffline.tunnel_monitoring " SQLStmt = SQLStmt & " where logdate=(select max(logdate) from phoffline.tunnel_monitoring " SQLStmt = SQLStmt & " where logdate between to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-2 " SQLStmt = SQLStmt & " and to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')) " Set RS1 = Connection.Execute(SQLStmt) ' response.write(SQLStmt) If Not RS1.EoF Then t_temperature=CDbl(RS1("temperature")) t_humidity=CDbl(RS1("humidity")) t_dewp=DewPoint(t_temperature,t_humidity) t_ddif=CDbl(RS1("ddif")) t_ddate=CStr(RS1("ddate")) t_chumid=CStr(RS1("chumid")) t_ctemp=CStr(RS1("ctemp")) End if Set RS1=nothing SQLStmt = " select to_char(logdate,'MM/DD/YYYY HH24:MI:SS') ddate, " SQLStmt = SQLStmt & " 24*60*(to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-logdate) ddif, " SQLStmt = SQLStmt & " to_char(temp_02,'90.0') ctemp,to_char(humid_02,'90') chumid, " SQLStmt = SQLStmt & " temp_02 temperature,humid_02 humidity" SQLStmt = SQLStmt & " from phoffline.dry_air_monitoring " SQLStmt = SQLStmt & " where logdate=(select max(logdate) from phoffline.dry_air_monitoring " SQLStmt = SQLStmt & " where logdate between to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-2 " SQLStmt = SQLStmt & " and to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')) " Set RS2 = Connection.Execute(SQLStmt) 'response.write(SQLStmt) If Not RS2.EoF Then e_temperature=CDbl(RS2("temperature")) e_humidity=CDbl(RS2("humidity")) e_dewp=DewPoint(e_temperature,e_humidity) e_ddif=CDbl(RS2("ddif")) e_ddate=CStr(RS2("ddate")) e_chumid=CStr(RS2("chumid")) e_ctemp=CStr(RS2("ctemp")) End if Set RS2=nothing SQLStmt = " select to_char(logdate,'MM/DD/YYYY HH24:MI:SS') ddate, " SQLStmt = SQLStmt & " 24*60*(to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-logdate) ddif, " SQLStmt = SQLStmt & " to_char(temp_el,'90.0') ctemp_el,to_char(nvl(humid_el,99),'90') chumid_el, " SQLStmt = SQLStmt & " temp_el,nvl(humid_el,99) humid_el," SQLStmt = SQLStmt & " to_char(temp_sr,'90.0') ctemp_sr,to_char(nvl(humid_sr,99),'90') chumid_sr, " SQLStmt = SQLStmt & " temp_sr,nvl(humid_sr,99) humid_sr" SQLStmt = SQLStmt & " from phoffline.cooling_monitoring " SQLStmt = SQLStmt & " where logdate=(select max(logdate) from phoffline.cooling_monitoring " SQLStmt = SQLStmt & " where logdate between to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-2 " SQLStmt = SQLStmt & " and to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')) " Set RS3 = Connection.Execute(SQLStmt) 'response.write(SQLStmt) If Not RS3.EoF Then If Not IsNull(RS3("temp_el")) Then el_temperature=CDbl(RS3("temp_el")) el_humidity=CDbl(RS3("humid_el")) el_dewp=DewPoint(el_temperature,el_humidity) el_ddif=CDbl(RS3("ddif")) el_ddate=CStr(RS3("ddate")) el_chumid=CStr(RS3("chumid_el")) el_ctemp=CStr(RS3("ctemp_el")) Else el_ddate="N/A" el_ctemp="N/A" el_chumid="N/A" el_diff=0. End If If Not IsNull(RS3("temp_sr")) Then sr_temperature=CDbl(RS3("temp_sr")) sr_humidity=CDbl(RS3("humid_sr")) sr_dewp=DewPoint(sr_temperature,sr_humidity) sr_ddif=CDbl(RS3("ddif")) sr_ddate=CStr(RS3("ddate")) sr_chumid=CStr(RS3("chumid_sr")) sr_ctemp=CStr(RS3("ctemp_sr")) Else sr_ddate="N/A" sr_ctemp="N/A" sr_chumid="N/A" sr_diff=0. End If Else el_ddate="N/A" el_ctemp="N/A" el_chumid="N/A" el_diff=0. sr_ddate="N/A" sr_ctemp="N/A" sr_chumid="N/A" sr_diff=0. End If Set RS3=nothing %>
Location Last DB write Temperature [C] Rel. Humidity[%] Dew Point[C]
Tunnel <% If t_ddif" & t_ddate & "") Else Response.write("" & t_ddate & "") End If %> <%=t_ctemp%> <%=t_chumid%> <%=Round(t_dewp,1)%>
Enclosure <% If e_ddif" & e_ddate & "") Else Response.write("" & e_ddate & "") End If %> <%=e_ctemp%> <%=e_chumid%> <%=Round(e_dewp,1)%>
Electronics Room <% If el_ddif" & el_ddate & "") Else Response.write("" & el_ddate & "") End If %> <%=el_ctemp%> <%=el_chumid%> <%=Round(el_dewp,1)%>
Shift Room <% If sr_ddif" & sr_ddate & "") Else Response.write("" & sr_ddate & "") End If %> <%=sr_ctemp%> <%=sr_chumid%> <%=Round(sr_dewp,1)%>
<% Connection.Close Set Connection=nothing %>