Sub
Berechnung()
Workbooks(s_name).Activate
Worksheets(
"Auswertung"
).
Select
d_helpVoc = 10000
d_helpIsc = 10000
d_minimum = 10000
For
n_zeile = 4
To
30000
Step
1
If
Cells(n_zeile, Range(
"AWT_Spannung_bel"
).Column) =
""
Then
Exit
For
Cells(n_zeile, Range(
"AWT_Stromdichte_bel"
).Column) = Cells(n_zeile, Range(
"AWT_Strom_bel"
).Column) / d_fläche * 1000
Cells(n_zeile, Range(
"AWT_Power_bel"
).Column) = Cells(n_zeile, Range(
"AWT_Spannung_bel"
).Column) * Cells(n_zeile, Range(
"AWT_Stromdichte_bel"
).Column)
Cells(n_zeile, Range(
"AWT_ABSspannung_bel"
).Column) = Abs(Cells(n_zeile, Range(
"AWT_Spannung_bel"
).Column))
Cells(n_zeile, Range(
"AWT_ABSstromdichte_bel"
).Column) = Abs(Cells(n_zeile, Range(
"AWT_Stromdichte_bel"
).Column))
If
Cells(n_zeile, Range(
"AWT_Power_bel"
).Column) < d_minimum
Then
d_minimum = Cells(n_zeile, Range(
"AWT_Power_bel"
).Column)
n_minimumMPP = n_zeile
End
If
If
Abs(Cells(n_zeile, Range(
"AWT_Spannung_bel"
).Column)) < d_helpIsc
Then
d_helpIsc = Abs(Cells(n_zeile, Range(
"AWT_Spannung_bel"
).Column))
n_Isc = n_zeile
End
If
If
Abs(Cells(n_zeile, Range(
"AWT_Stromdichte_bel"
).Column)) < d_helpVoc
Then
d_helpVoc = Abs(Cells(n_zeile, Range(
"AWT_Stromdichte_bel"
).Column))
n_Voc = n_zeile
End
If
Next
n_zeile
d_voc = Cells(n_Voc, Range(
"AWT_ABSspannung_bel"
).Column)
d_isc = Cells(n_Isc, Range(
"AWT_ABSstromdichte_bel"
).Column)
d_vmpp = Cells(n_minimumMPP, Range(
"AWT_ABSspannung_bel"
).Column)
d_impp = Cells(n_minimumMPP, Range(
"AWT_ABSstromdichte_bel"
).Column)
d_Vmin = Cells(4, Range(
"AWT_Spannung_bel"
).Column)
d_Vmax = Cells(n_zeile - 1, Range(
"AWT_Spannung_bel"
).Column)
If
d_isc <> 0
Then
d_grenze = 1
n_stelle = 0
Do
Until
d_isc > d_grenze
n_stelle = n_stelle + 1
d_grenze = d_grenze / 10
Loop
d_Uscale = Round(d_isc, n_stelle)
d_isc_round = Round(d_isc, n_stelle + 2)
End
If
If
d_impp <> 0
Then
d_grenze = 1
n_stelle = 0
Do
Until
d_impp > d_grenze
n_stelle = n_stelle + 1
d_grenze = d_grenze / 10
Loop
d_impp_round = Round(d_impp, n_stelle + 2)
End
If
If
d_voc <> 0
Then
d_grenze = 1
n_stelle = 0
Do
Until
d_voc > d_grenze
n_stelle = n_stelle + 1
d_grenze = d_grenze / 10
Loop
d_voc_round = Round(d_voc, n_stelle + 2)
End
If
If
d_vmpp <> 0
Then
d_grenze = 1
n_stelle = 0
Do
Until
d_vmpp > d_grenze
n_stelle = n_stelle + 1
d_grenze = d_grenze / 10
Loop
d_vmpp_round = Round(d_vmpp, n_stelle + 2)
End
If
If
s_DarkFile =
"Falsch"
Or
s_DarkFile =
"no"
Then
GoTo
Skip_calculation
Worksheets(
"Auswertung"
).
Select
For
n_zeile_1 = 4
To
30000
Step
1
If
Cells(n_zeile_1, Range(
"AWT_Strom_dark"
).Column) =
""
And
Cells(n_zeile_1 + 1, Range(
"AWT_Strom_dark"
).Column) =
""
Then
Exit
For
Cells(n_zeile_1, Range(
"AWT_Stromdichte_dark"
).Column) = Cells(n_zeile_1, Range(
"AWT_Strom_dark"
).Column) / d_fläche * 1000
Cells(n_zeile_1, Range(
"AWT_Power_dark"
).Column) = Cells(n_zeile_1, Range(
"AWT_Spannung_dark"
).Column) * Cells(n_zeile_1, Range(
"AWT_Stromdichte_dark"
).Column)
Cells(n_zeile_1, Range(
"AWT_ABSspannung_dark"
).Column) = Abs(Cells(n_zeile_1, Range(
"AWT_Spannung_dark"
).Column))
Cells(n_zeile_1, Range(
"AWT_ABSstromdichte_dark"
).Column) = Abs(Cells(n_zeile_1, Range(
"AWT_Stromdichte_dark"
).Column))
Next
n_zeile_1
Skip_calculation:
If
d_voc <> 0
Then
d_FF = d_impp * d_vmpp / (d_isc * d_voc) * 100
Else
: d_FF = 0
End
If
d_eff = d_voc * d_isc * d_FF / d_belst
If
d_eff <> 0
Then
d_grenze = 1
n_stelle = 0
Do
Until
d_eff > d_grenze
n_stelle = n_stelle + 1
d_grenze = d_grenze / 10
Loop
d_eff_round = Round(d_eff, n_stelle + 2)
d_FF_round = Round(d_FF, 1)
End
If
End
Sub
Sub
Diagramme()
Worksheets(
"Diagramme"
).
Select
ActiveSheet.ChartObjects(
"Chart 1"
).Activate
ActiveChart.ChartArea.
Select
ActiveChart.SeriesCollection(1).XValues =
"=Auswertung!R4C4:R"
& n_zeile - 1 &
"C4"
ActiveChart.SeriesCollection(1).Values =
"=Auswertung!R4C6:R"
& n_zeile - 1 &
"C6"
If
s_DarkFile =
"Falsch"
Or
s_DarkFile =
"no"
Then
GoTo
Skip_chart
If
Sheets(
"Auswertung"
).Cells(n_zeile_1, Range(
"AWT_Strom_dark"
).Column) =
""
And
Cells(n_zeile_1 + 1, Range(
"AWT_Strom_dark"
).Column) =
""
Then
GoTo
Skip_chart
ActiveChart.SeriesCollection(2).XValues =
"=Auswertung!R4C11:R"
& n_zeile_1 - 1 &
"C11"
ActiveChart.SeriesCollection(2).Values =
"=Auswertung!R4C13:R"
& n_zeile_1 - 1 &
"C13"
Skip_chart:
ActiveChart.ChartArea.
Select
ActiveChart.Shapes(
"Text Box 2"
).
Select
Selection.Characters.Text = _
"VOC="
& d_voc_round &
" [V]"
& Chr(10) &
"ISC="
& d_isc_round &
" [mA/cm²]"
& Chr(10) & _
"VMPP="
& d_vmpp_round &
" [V]"
& Chr(10) &
"IMPP="
& d_impp_round &
" [mA/cm²]"
& Chr(10) & _
"FF="
& d_FF_round &
" [%]"
& Chr(10) & _
ChrW(951) &
"="
& d_eff_round &
" [%]"
Selection.AutoScaleFont =
False
With
Selection.Characters(Start:=1, Length:=107).Font
.Name =
"Arial"
.FontStyle =
"Standard"
.Size = 10
.Strikethrough =
False
.Superscript =
False
.Subscript =
False
.OutlineFont =
True
.Shadow =
False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End
With
With
ActiveChart.Axes(xlValue)
.MinorUnitIsAuto =
True
.MajorUnitIsAuto =
True
.Crosses = xlAutomatic
.ReversePlotOrder =
False
.ScaleType = xlLinear
.DisplayUnit = xlNone
If
b_Scale =
True
Then
.MinimumScale = frm_InsertSolarCell.txt_Min
.MaximumScale = frm_InsertSolarCell.txt_Max
Else
If
b_StandardScale =
True
Then
.MinimumScale = -15
.MaximumScale = 10
Else
.MinimumScale = -d_Uscale * 2
.MaximumScale = d_Uscale * 3
End
If
End
If
End
With
If
d_Vmax > d_Vmin
Then
d_Xmax = d_Vmax
d_Xmin = d_Vmin
Else
d_Xmax = d_Vmin
d_Xmin = d_Vmax
End
If
ActiveChart.Axes(xlCategory).
Select
Selection.TickLabels.NumberFormat =
"0.0"
With
ActiveChart.Axes(xlCategory)
.MinorUnitIsAuto =
True
.MajorUnitIsAuto =
True
.Crosses = xlAutomatic
.ReversePlotOrder =
False
.ScaleType = xlLinear
.DisplayUnit = xlNone
If
b_Scale_X =
True
Then
.MinimumScale = frm_InsertSolarCell.txt_Min_X
.MaximumScale = frm_InsertSolarCell.txt_Max_X
Else
If
b_StandardScale_X =
True
Then
.MinimumScale = -0.5
.MaximumScale = 1
Else
.MinimumScale = d_Xmin
.MaximumScale = d_Xmax
End
If
End
If
End
With
ActiveChart.ChartArea.
Select
End
Sub
Sub
Insert_Celldata()
Sheets(
"Solarzellen"
).
Select
n_LastRowNr = GetLastRowNumber(
"Solarzellen"
, Range(
"SC_Operator"
).Column, 3)
Cells(n_LastRowNr, Range(
"SC_Filename"
).Column) = s_FileName
Cells(n_LastRowNr, Range(
"SC_Operator"
).Column) = frm_InsertSolarCell.cbo_Name.Text
Cells(n_LastRowNr, Range(
"SC_Datum"
).Column) = frm_InsertSolarCell.txt_Datum.Value
Cells(n_LastRowNr, Range(
"SC_Serie"
).Column) = frm_InsertSolarCell.txt_Serie.Text
Cells(n_LastRowNr, Range(
"SC_Device"
).Column) = frm_InsertSolarCell.cbo_Device.Text
Cells(n_LastRowNr, Range(
"SC_Pos"
).Column) = n_Zellenposition
Cells(n_LastRowNr, Range(
"SC_Typ"
).Column) = frm_InsertSolarCell.cbo_Typ.Text
Cells(n_LastRowNr, Range(
"SC_Organik"
).Column) = frm_InsertSolarCell.cbo_Organik.Text
Cells(n_LastRowNr, Range(
"SC_Anorganik"
).Column) = frm_InsertSolarCell.cbo_Anorganik.Text
Cells(n_LastRowNr, Range(
"SC_Elektrode2"
).Column) = frm_InsertSolarCell.cbo_Elektrode2.Text
Cells(n_LastRowNr, Range(
"SC_Zschicht"
).Column) = frm_InsertSolarCell.cbo_Zschicht.Text
Cells(n_LastRowNr, Range(
"SC_Fläche"
).Column) = frm_InsertSolarCell.txt_Fläche.Text
Cells(n_LastRowNr, Range(
"SC_Belichtungsstärke"
).Column) = frm_InsertSolarCell.txt_Belichtungsstärke.Text
Cells(n_LastRowNr, Range(
"SC_PolyCharge"
).Column) = frm_InsertSolarCell.cbo_PolyCharge.Text
Cells(n_LastRowNr, Range(
"SC_IndiumCharge"
).Column) = frm_InsertSolarCell.cbo_IndiumCharge.Text
Cells(n_LastRowNr, Range(
"SC_KupferCharge"
).Column) = frm_InsertSolarCell.cbo_KupferCharge.Text
Cells(n_LastRowNr, Range(
"SC_Temp"
).Column) = frm_InsertSolarCell.txt_Temp.Text
Cells(n_LastRowNr, Range(
"SC_DruckT"
).Column) = frm_InsertSolarCell.txt_DruckT.Text
Cells(n_LastRowNr, Range(
"SC_Druck"
).Column) = frm_InsertSolarCell.txt_Druck.Text
Cells(n_LastRowNr, Range(
"SC_Kommentar"
).Column) = frm_InsertSolarCell.txt_Kommentar.Text
Cells(n_LastRowNr, Range(
"SC_ID"
).Column) = Cells(n_LastRowNr - 1, Range(
"SC_ID"
).Column) + 1
Cells(n_LastRowNr, Range(
"SC_VOC"
).Column) = d_voc
Cells(n_LastRowNr, Range(
"SC_ISC"
).Column) = d_isc
Cells(n_LastRowNr, Range(
"SC_VMPP"
).Column) = d_vmpp
Cells(n_LastRowNr, Range(
"SC_IMPP"
).Column) = d_impp
Cells(n_LastRowNr, Range(
"SC_FF"
).Column) = d_FF
Cells(n_LastRowNr, Range(
"SC_Eff"
).Column) = d_eff
End
Sub