%@ LANGUAGE="VBScript" %>
<%
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Mode = adModeRead
Connection.Open phdb_rd
If IsEmpty(Request("rowid_x")) Then
rowid_query="select rowid,to_char(Logdate,'mm/dd/yyyy hh:mi:ss AM') ldate,operator,comments from sitester.sensor_log "
rowid_query=rowid_query & " where batch='" & Request("batch") & "' and sensor=" & Request("sensor") & " and action='Long_current' "
rowid_query=rowid_query & " and measurement_type='GUARD' order by logdate"
Set rowid_list=Connection.Execute(rowid_query)
times_tested=0
Do While Not rowid_list.EOF
times_tested=times_tested+1
rowid_list.MoveNext
Loop
If times_tested>0 Then
rowid_list.MoveFirst
End If
If times_tested = 1 Then
rowid_x=rowid_list("rowid")
End If
Else
rowid_x=Request("rowid_x")
' KG added following to set ymax value
If Not IsEmpty(Request("ymax")) Then
ymax = CDbl(Request("ymax"))
End If
End If
%>
Time Dependence of Leakage Current
<% If IsEmpty(rowid_x) Then %>
Batch <%=Request("batch")%>, sensor <%=Request("sensor")%> Leakage Current Measurements
<% End If %>
<% Else %>
<% start_time = Time %>
<%
Log1_Query = "select Rowid,Batch,Sensor,to_char(Logdate,'mm/dd/yyyy hh:mi:ss AM') ldate,Action,Measurement_Type,Operator,Comments "
Log1_Query = Log1_Query & "from sitester.sensor_log sl where sl.rowid='"
Log1_Query = Log1_Query & rowid_x & "'"
Set Slog1 = Connection.Execute(Log1_Query)
batch1=Slog1("Batch")
sensor1=Slog1("Sensor")
logdate1=Slog1("Ldate")
action1=Slog1("Action")
measurement1=Slog1("Measurement_Type")
rowid1=Slog1("Rowid")
operator1=Slog1("Operator")
comm1=Slog1("Comments")
%>
<%
'
' Find the best candidate for the same-pair measurement (guard vs bias), check within +-10 minutes
'
If Cstr(action1)="Long_current" Then
If measurement1="BIAS" Then
measurement2="GUARD"
ElseIf measurement1="GUARD" Then
measurement2="BIAS"
Else
response.write("Invalid measurement type !")
End If
Else
response.write(" This is not a long term current test !")
End If
Log2_Query = "select rowid,batch,sensor,logdate,action,measurement_type,operator,comments "
Log2_Query = Log2_Query & "from sitester.sensor_log sl where sl.measurement_type='" & Cstr(measurement2) & "'"
Log2_Query = Log2_Query & " and sl.batch='" & CStr(batch1) & "' and sl.sensor=" & CStr(sensor1)
Log2_Query = Log2_Query & " and 24*60*abs(sl.logdate-" & "TO_DATE('" & CStr(logdate1) & "','mm/dd/yyyy hh:mi:ss AM'))<10"
Set Slog2 = Connection.Execute(Log2_Query)
If Not Slog2.EOF Then
rowid2=Slog2("Rowid")
logdate2=Slog2("logdate")
operator2=Slog2("Operator")
comm2=Slog2("Comments")
Else
rowid2="Not found"
logdate2="Not found"
operator2="-"
comm2="-"
measurement2="-"
End If
If measurement2="BIAS" Then 'swap the pointers
rowid_t=rowid1
rowid1=rowid2
rowid2=rowid_t
comm_t=comm1
comm1=comm2
comm2=comm_t
logdate_t=logdate1
logdate1=logdate2
logdate2=logdate_t
operator_t=operator1
operator1=operator2
operator1=operator_t
measurement_t=measurement1
measurement1=measurement2
measurement2=measurement_t
End If
%>
<%
LI1_Query = "select to_char(li.testdate,'hh24:mi:ss') ttime,to_char(li.testdate,'mm/dd/yyyy') tdate,li.leakage_current,li.temperature temp FROM sitester.longterm_i li,sitester.sensor_log sl "
LI1_Query = LI1_Query & "where sl.rowid='" & Cstr(rowid1) & "' "
LI1_Query = LI1_Query & "and li.startdate=sl.logdate order by li.testdate"
Set SLI1 = Connection.Execute(LI1_Query)
Temp_Query = "select to_char(li.testdate,'hh24:mi:ss') ttime,to_char(li.testdate,'mm/dd/yyyy') tdate,li.temperature temp FROM sitester.longterm_i li,sitester.sensor_log sl "
Temp_Query = Temp_Query & "where sl.rowid='" & Cstr(rowid1) & "' "
Temp_Query = Temp_Query & "and li.startdate=sl.logdate order by li.testdate"
Set STemp=Connection.Execute(Temp_Query)
Volt1_Query="select max(bias) mbias from sitester.longterm_i li,sitester.sensor_log sl "
Volt1_Query = Volt1_Query & "where sl.rowid='" & Cstr(rowid1) & "' "
Volt1_Query = Volt1_Query & "and li.startdate=sl.logdate group by li.startdate"
Set SVolt1=Connection.Execute(Volt1_Query)
Volt1="N/A"
Volt2="N/A"
If Not SVolt1.EOF Then
Volt1=Cstr(SVolt1("mbias")) & " V"
End if
If Cstr(rowid2)<>"Not found" Then
LI2_Query = "select to_char(li.testdate,'hh24:mi:ss') ttime,to_char(li.testdate,'mm/dd/yyyy') tdate,li.leakage_current,li.temperature temp from sitester.longterm_i li,sitester.sensor_log sl "
LI2_Query = LI2_Query & "where sl.rowid='" & Cstr(rowid2) & "' "
LI2_Query = LI2_Query & "and li.startdate=sl.logdate order by li.testdate"
Set SLI2 = Connection.Execute(LI2_Query)
Volt2_Query="select max(bias) mbias from sitester.longterm_i li,sitester.sensor_log sl "
Volt2_Query = Volt2_Query & "where sl.rowid='" & Cstr(rowid1) & "' "
Volt2_Query = Volt2_Query & "and li.startdate=sl.logdate group by li.startdate"
Set SVolt2=Connection.Execute(Volt2_Query)
If Not SVolt2.EOF Then
Volt2=Cstr(SVolt2("mbias")) & " V"
End if
End If
%>
Batch <%=Slog1("batch")%>, sensor <%=Cstr(Slog1("sensor"))%> Leakage Current
Measurement Date
<%=logdate1%>
<%=logdate2%>
Measurement Type
<%=measurement1%>
<%=measurement2%>
Operator
<%=operator1%>
<%=operator2%>
Operator's Comments
<%=comm1%>
<%=comm2%>
Bias Voltage
<%=volt1 %>
<%=Volt2 %>
Humidity
<%=" % "%>
<%=" % "%>
Leakage Current:
Active Area Normalized to T=25 deg C,
Guard Ring, not normalized
<%
' Prepare current plot
seed=-(second(now())+60*minute(now())+3600*hour(now())+3600*24*day(now()))
filename="lili" & cstr(int(100000.*rnd(seed))) & ".jpg"
filename_full=ph_image_directory & filename
Dim Chart
Dim Color(8)
Color(0) = vbRed
Color(1) = vbBlue
Color(2) = vbYellow
Color(3) = vbGreen
Color(4)= vbMagenta
Color(5)= vbCyan
Color(6)= vbWhite
Color(7)= vbBlack
rem **********************************************************************
rem * Instantiate the Chart component
rem **********************************************************************
Set Chart = Server.CreateObject ("ASPChart.Chart")
rem **********************************************************************
rem * Create x Array
rem **********************************************************************
Chart.AddSeries 5
Chart.SeriesTitle = "Active Area, Normalized to T=25 deg C"
Chart.LineWidth = 2
Chart.Stairs = false
Chart.SeriesInLegend = true
If measurement1="BIAS" Then
color_1=vbBlue
Else
color_1=vbMagenta
End If
If Not SLI1.EOF Then
time_begin=TimeValue(SLI1("ttime"))
date_begin=DateValue(SLI1("tdate"))
' time_begin=date_begin+time_begin
time_begin=date_begin
End If
npoints=0
Do While Not SLI1.Eof
time1=TimeValue(SLI1("ttime"))
date1=DateValue(SLI1("tdate"))
time1=date1+time1
' hours1=24*(time1-time_begin)
hours1=(time1-time_begin)
Chart.AddXY Cdbl(hours1),0.001*CDbl(SLI1("leakage_current"))*exp(-0.095*(CDbl(SLI1("temp"))-25)), "",color_1
SLI1.MoveNext
Loop
end_time=hours1
If Cstr(rowid2)<>"Not found" Then
Chart.AddSeries 5
Chart.SeriesTitle = "Guard Ring"
Chart.LineWidth = 2
Chart.Stairs = false
Chart.SeriesInLegend = true
If measurement2="BIAS" Then
color_2=vbBlue
Else
color_2=vbMagenta
End If
If Not SLI2.EOF Then
time_begin=TimeValue(SLI2("ttime"))
date_begin=DateValue(SLI2("tdate"))
' time_begin=date_begin+time_begin
time_begin=date_begin
End If
Do While Not SLI2.Eof
time2=TimeValue(SLI2("ttime"))
date2=DateValue(SLI2("tdate"))
time2=date2+time2
' hours2=24*(time2-time_begin)
hours2=(time2-time_begin)
Chart.AddXY Cdbl(hours2),0.001*CDbl(SLI2("leakage_current")),"",color_2
SLI2.MoveNext
Loop
End If
rem **********************************************************************
rem * Add and format the title
rem **********************************************************************
rem Chart.ChartTitleAdd ("Leakage Curent")
rem Chart.ChartTitleFont.Size = 14
rem Chart.ChartTitleFont.Name = "Times New Roman"
rem Chart.ChartTitleFont.Italic = true
rem Chart.ChartTitleFont.Bold = true
Chart.View3D = false
Chart.LegendVisible = false
Chart.LegendStyle = cSeries
Chart.LegendPosition = cBottom
Chart.AxisGridLines = true
Chart.Frame = false
Chart.BottomAxisIncrement = 0.5
rem **********************************************************************
rem * Remove the OuterBevel, add a gradient fill to chart panel
rem **********************************************************************
Chart.BevelOuter = 0
rem Chart.GradientVisible = true
rem Chart.GradientStartColor = vbWhite
rem Chart.GradientEndColor = vbYellow
Chart.PanelColor = Color(6)
rem **********************************************************************
rem * Set the Width and Height of the image
rem **********************************************************************
Chart.Height = 400
Chart.Width = 600
Chart.HorizAxisMin = 0.
Chart.HorizAxisMax = end_time
rem **********************************************************************
rem * GSFS changed maximum to 20 5/3/2000
rem * KG added possibility of setting ymax from URL (with parameter ymax)
rem * 20 will remain as default if no ymax is defined. Also, this
rem * functionality should only work if the rowid is set in the URL
rem * which should not allow it to be used from batch report. I don't
rem * want this to occur because a reload to view a new ymax may make
rem * the longterm current page lose it reference back to the batch report
rem * page and not allow the shipping of data back to the batch report page
rem **********************************************************************
If IsEmpty(ymax) Then
Chart.VertAxisMax = 20.0
Else
Chart.VertAxisMax = ymax
End If
Chart.VertAxisMin = -0.25
Chart.AddAxisLabel 1 , "Current [microA]"
Chart.AddAxisLabel 2 , "Time [days] (starts at midnight before)"
rem **********************************************************************
rem * Set the filename, save the image and write the image tag
rem **********************************************************************
Chart.FileName = filename_full
Chart.SaveChart
line="
"
Response.Write (line)
rem **********************************************************************
rem * Destroy the object
rem **********************************************************************
Set Chart = nothing
' Prepare temperature plot
seed=-(second(now())+60*minute(now())+3600*hour(now())+3600*24*day(now()))
filename="tsts" & cstr(int(100000.*rnd(seed))) & ".jpg"
filename_full="f:\pub\www\PublicDatabase\ASPGraph\images\" & filename
rem **********************************************************************
rem * Instantiate the Chart component
rem **********************************************************************
Set Chart = Server.CreateObject ("ASPChart.Chart")
rem **********************************************************************
rem * Create x Array
rem **********************************************************************
Chart.AddSeries 5
Chart.SeriesTitle = "Temperature"
Chart.LineWidth = 2
Chart.Stairs = false
Chart.SeriesInLegend = false
If Not Stemp.EOF Then
time_begin=TimeValue(STemp("ttime"))
date_begin=DateValue(STemp("tdate"))
' time_begin=date_begin+time_begin
time_begin=date_begin
End If
Do While Not STemp.Eof
time1=TimeValue(STemp("ttime"))
date1=DateValue(STemp("tdate"))
time1=date1+time1
' hours1=24*(time1-time_begin)
hours1=(time1-time_begin)
Chart.AddXY Cdbl(hours1),CDbl(STemp("temp")), "",Color(1)
STemp.MoveNext
Loop
rem **********************************************************************
rem * Add and format the title
rem **********************************************************************
Chart.ChartTitleAdd ("Temperature")
Chart.ChartTitleFont.Size = 18
Chart.ChartTitleFont.Name = "Times New Roman"
Chart.ChartTitleFont.Italic = true
Chart.ChartTitleFont.Bold = true
Chart.View3D = false
Chart.LegendVisible = false
Chart.LegendStyle = cSeries
Chart.AxisGridLines = true
Chart.Frame = false
Chart.BottomAxisIncrement = 0.5
rem **********************************************************************
rem * Remove the OuterBevel, add a gradient fill to chart panel
rem **********************************************************************
Chart.BevelOuter = 0
rem Chart.GradientVisible = true
rem Chart.GradientStartColor = vbWhite
rem Chart.GradientEndColor = vbYellow
Chart.PanelColor = Color(6)
rem **********************************************************************
rem * Set the Width and Height of the image
rem **********************************************************************
Chart.Height = 400
Chart.Width = 600
Chart.HorizAxisMin = 0.
Chart.HorizAxisMax = end_time
Chart.VertAxisMax = 35.0
Chart.VertAxisMin = 10.
Chart.AddAxisLabel 1 , "Temperature [degC]"
Chart.AddAxisLabel 2 , "Time [days]"
rem **********************************************************************
rem * Set the filename, save the image and write the image tag
rem **********************************************************************
Chart.FileName = filename_full
Chart.SaveChart
line="
"
Response.Write (line)
rem **********************************************************************
rem * Destroy the object
rem **********************************************************************
Set Chart = nothing
%>
<%
End If
' Database is not needed anymore !
Connection.Close
%>