<%@ LANGUAGE="VBScript" %> <% 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 Not IsEmpty(request.form("Latest")) Then timedate="" End If If timedate="" Then SQLStmtX = " select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS') timedate from dual " Set RSX = Connection.Execute(SQLStmtX) timedate = CStr(RSX("timedate")) End If ' response.write(SQLStmtX) If Not IsDate(timedate) Then message="Wrong Time/Date format " & timedate %> <% End If timedate_par=replace(timedate," ","%20") %> LCHV Status
               

LHCV Status

<% SQLStmt = " select to_char(lhv.logdate,'MM/DD hh24:mi:ss') ddate, " SQLStmt = SQLStmt & " 24*60*(to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-lhv.logdate) ddif, " SQLStmt = SQLStmt & " lhv.logdate,lhv.hv_group,lhv.hv_channel,to_char(lhv.v_meas,'9999.9') v_meas,to_char(lhv.i_meas,'9999.9') i_meas,to_char(lhv.v_req,'9999') v_req,lhv.enabled " SQLStmt = SQLStmt & " from phoffline.lecroy_hv lhv, " SQLStmt = SQLStmt & " (select max(logdate) logdate,hv_group,hv_channel " SQLStmt = SQLStmt & " from phoffline.lecroy_hv " SQLStmt = SQLStmt & " where logdate between to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')-2 and to_date('" & timedate & "','MM/DD/YYYY HH24:MI:SS')" SQLStmt = SQLStmt & " group by hv_group,hv_channel) sc " SQLStmt = SQLStmt & " where lhv.logdate=sc.logdate " SQLStmt = SQLStmt & " and lhv.hv_group=sc.hv_group " SQLStmt = SQLStmt & " and lhv.hv_channel=sc.hv_channel " SQLStmt = SQLStmt & " order by lhv.hv_group,lhv.hv_channel " Set RS = Connection.Execute(SQLStmt) ' response.write(SQLStmt) %>
<% Do While Not RS.EOF ' ' check voltages ' If Abs(CDbl(RS("V_Meas"))-CDbl(RS("V_req")))>30 And CInt(RS("enabled"))=1 Then HV_OK=false Else HV_OK=true End If %> <% RS.Movenext Loop %>
HV Grp HV Chan Graph DB write V V Req I Stat
<%=RS("hv_group")%> <%=RS("hv_channel")%>

&hv_channel=<%=RS("hv_channel")%>&days=2" onClick="openWindow(this,'LHCV',.45,0.75,'no',0.75,0.4)">Graph

<% If CDbl(RS("ddif"))" & CStr(RS("ddate")) & "") Else Response.write("" & CStr(RS("ddate")) & "") End If %> <%=Trim(RS("V_Meas"))%> <% If Not HV_OK Then %> <% End If %> <%=Trim(RS("V_req"))%> <%=Trim(RS("I_meas"))%> <% If CInt(RS("enabled"))=1 Then 'channel is enabled Response.write(" E ") Else Response.write(" D ") End If %>
<% Connection.Close Set RS=nothing Set Connection=nothing %>