Hi there,
I developed a small program for the PCSGU250 that shows me the waves I set in the generator. Problem is that if I tell the sub chbRun_Checkchanged to show me the wave it doesn´t work with the first try. Although it activates the button in the PC2000Lab.exe, it doesn´t seem to get the data out of the buffer. The second time I start the Sub it works just fine.
[code]Private Sub chbRun_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chbRun.CheckedChanged
Dim s, t, u As New Series
Dim i As Double
s.Name = "Ch1"
t.Name = "Ch2"
u.Name = "Kennlinie"
If chbRun.Checked = True Then
RunOn(1)
'delete chart and declare new Data Series
chrOszi.Series.Clear()
chr3.Series.Clear()
chrOszi.ResetAutoValues()
chr3.ResetAutoValues()
'read Datapoints out of databuffer
ReadCh1(DataBuffer1(0))
ReadCh2(DataBuffer2(0))
'read out the data of buffer1 and buffer2
For i = 0 To 4095
'add points of data to series
s.Points.AddXY(i, CDbl(DataBuffer1(i + 3)))
t.Points.AddXY(i, CDbl(DataBuffer2(i + 3)))
u.Points.AddXY(CDbl(DataBuffer2(i + 3)), CDbl(DataBuffer1(i + 3)))
Next
s.ChartType = SeriesChartType.Line
t.ChartType = SeriesChartType.Line
u.ChartType = SeriesChartType.Line
'Adds the DataSeries to chart
chrOszi.Series.Add(s)
chrOszi.Series.Add(t)
chr3.Series.Add(u)
Else
RunOn(0)
End If
End Sub[/code]
I´m using MS Visual Basic Express 2010, if that´s of any relevance.
Well thanks for reading so far, and hopefully I shared enough information with you to solve this problem.
with kind regards
Jan