Private Sub CreateChart()

Dim time2, tp As String


Try
Dim sr2 As New StreamReader("D:\Temp\datalogger\" & date1.ToString & "\int_sma_" + date1.ToString + ".txt")
Dim line7 = sr2.ReadLine
Dim tn = timeNow()

Do While Not line7 Is Nothing 'loop until end of file

If IsNumeric(line7.Chars(0)) Then
If Directory.Exists("D:\Temp\datalogger\" & date1) Then
If File.Exists("D:\Temp\datalogger\" & date1 & "\int_sma_" & date1 & ".txt") Then


Dim k = sr2.ReadToEnd
Dim y = k.Clone

Dim fields3() = Split(k.Substring(k.IndexOf(tn)), ";")
Dim fields2() = Split(y.Substring(y.IndexOf(tn)), ";")
Dim fields6() = Split(line7, ";")

time2 = fields6(0)
tp = fields2(19) + fields3(53)

Chart1.Series("Totalpower").Points.AddXY(time2, tp)

sr2.Close()
End If
End If
End If

line7 = sr2.ReadLine


Loop


Catch ex As Exception

End Try

Dim time1, irrd4 As String


Try
Dim lc As New StreamReader("D:\Temp\datalogger\" & date1.ToString & "\int_ana_" + date1.ToString + ".txt")


Dim line6 = lc.ReadLine

Do While Not line6 Is Nothing 'loop until end of file
If IsNumeric(line6.Chars(0)) Then
Dim fields5() = Split(line6, ";")

time1 = fields5(0) 'getting time from textfile

irrd4 = fields5(3) 'getting irrd from textfile


Chart1.Series("Irradiance").Points.AddXY(time1, irrd4)

End If
line6 = lc.ReadLine

Loop


Catch ex As Exception

End Try

_________________________________________
'' however this works ''

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.