<%@ LANGUAGE="VBScript" %> <% Server.ScriptTimeout =500 Dim Run() Dim Sequence() Dim Logid() Set Connection = Server.CreateObject("ADODB.Connection") Connection.Open phdb_rd SQLStmt = " select rn.run,rn.logid from phoffline.run_numbers rn,phoffline.log_entries le " SQLStmt = SQLStmt & " where le.logid=rn.logid and (le.action='START_RUN' or le.action='NEW_RUN_SEQUENCE') " SQLStmt = SQLStmt & " and rn.run<5001 " SQLStmt = SQLStmt & " order by le.log_date,le.logid " ' response.write(SQLStmt) Set RS = Connection.Execute(SQLStmt) %> Run Calibrations

Fill Run and Sequence Table

This script is totally temporary. This table needs to be filled automatically by DAQ

<% Run_Old=-999999 Nall=-1 Do While Not RS.EoF Nall=Nall+1 ReDim Preserve Run(Nall) ReDim Preserve Sequence(Nall) ReDim Preserve Logid(Nall) Run(Nall)=CLng(RS("run")) Logid(Nall)=CLng(RS("Logid")) If Run(Nall)=Run_Old Then Nseq=Nseq+1 Else NSeq=0 Run_Old=Run(Nall) End If Sequence(Nall)=Nseq RS.MoveNext Loop ' ' Insert data into the table ! ' %> <% For i=0 To Nall SQLStmt = " insert into phoffline.runseq_numbers (run,sequence,logid) " SQLStmt = SQLStmt & " values(" & Run(i) & "," & Sequence(i) & "," & Logid(i) & ")" ' response.write(SQLStmt & "
") On Error Resume Next Set RSI = Connection.Execute(SQLStmt) If Err.Number=0 Then stat="Filled Now" Elseif Err.Number=&H80040e2f Then Stat="Already Filled" Else stat=Err.Description End if %> <% Next %>
N Run Sequence Logid Stat
<%= i+1 %> <%= Run(i) %> <%= Sequence(i) %> <%= Logid(i) %> <%= stat %>
<% Connection.Close %>