0

I want to get the raw data from an analogwaveform channel and simply load it into an array of Doubles. Here is what I have:

Dim data() As AnalogWaveform(Of Double)
    Dim dataToFilter() As Double

    For Each WaveformGraph In WFGS
        dataToFilter(i) = data(i).GetRawData() 'Value of Type '1-dimensional array of Double' cannot be converted to 'Double'.
        WaveformGraph.PlotWaveformAppend(data(i))
        i = i + 1
    Next

Can someone please help me with the line of code in question. I need to get the raw data from the analogwaveform so that I can apply a filter to it before I stream it to a Waveformgraph.

Thanks.

busarider29
  • 185
  • 5
  • 18
  • You are declaring your `AnalogWaveform(Of Double)`, but it is never assigned. Right after you fix your current problem, you'll run into a `NullReferenceException`. It needs to come from somewhere. Also, I believe your `data()` (an array) should really be just `data`. – Kirill Shlenskiy Feb 22 '16 at 22:48
  • I'm going with the assumption the OP has given us relevant fragments. – MrGadget Feb 22 '16 at 23:02

1 Answers1

1
Dim data() As AnalogWaveform(Of Double)
Dim dataToFilter As New List(Of Double())

Dim i As Integer = 0
For Each WaveformGraph In WFGS
    dataToFilter.Add(data(i).GetRawData())
    WaveformGraph.PlotWaveformAppend(data(i))
    i += 1
Next
MrGadget
  • 1,258
  • 1
  • 10
  • 19
  • Your error tells me that "GetRawData()" returns an array of Double. I've therefore set dataToFilter up as a List of Double arrays, in other words each element in the List is an array of type Double. – MrGadget Feb 22 '16 at 22:52