Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

PlotWaveformAppend<> with TimeStamp options?

Recently, I have been tasked with providing a graph to display data that is being read asynchronously.

 

My data is aquired as an array of doubles, with an array of PrecisionDateTime's to act as time stamps for each data point.

 

There are two modes that this graph needs to implement, a "scope" mode and a "charting" mode.

 

In "scope" mode, I use PlotWaveform<> so I can specify plot options to include the AnalogWaveformPlotDisplayMode.Time, and it constantly updates the XAxes range to the range of my PrecisionDateTime array. This is perfect, it "fits" the graph to my waveform.

 

However, when I am in charting mode I need to append both my waveform data and the waveform time stamps. The PlotWaveformAppend<> method does not allow the client to specify plot options, probably because the client would have to ensure that the appended data was time stamped after the previous data.

 

My AnalogWaveform<>'s PrecisionTiming parameter is set to CreateWithIrregularInterval with my precision time stamps, but the graph does not use the time stamps to scale the XAxes.

 

Can anyone point me in the right direction? I'd rather not have to manually update the XAxes range every time I plot data.

 

Thanks,

 

-Steven

0 Kudos
Message 1 of 5
(3,767 Views)

Hi shansen,

 

One option that you can try is appending the data to your array prior to plotting it, and then replotting the data after each appendage.  Would this work for you?

Cheers,
Kelly R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,743 Views)

Kelly,

 

Sorry about the long time in getting back to you. I'm not quite sure what you mean by appending the data to my array before plotting.

 

My problem is when you call the WaveformAppend<> method, you cannot specify plot options to include TimeStamps.

 

When I create my waveform, I set the PrecisionTiming property to CreateWithIrregularIntervals with my time stamps, but the time stamps

 

are not plotted on the X Axis when I call WaveformAppend<>.

 

I hope I was a little bit more clear, if not, feel free to let me know!

 

Thanks,

 

Steven Hansen

Anderson Electric Controls

0 Kudos
Message 3 of 5
(3,706 Views)

Hi Steven,

 

Unfortunately, I do not think there is a way to append data with timestamps to a waveform using the waveformappend method, but one option would be to maintain a 2 dimensional array containing all of your double data and timestamps, and append any new data to this array. Then, use the plotwaveform method as in your first case to plot this array each time new data is added.  Since the array contains both the old and new data, this replot will in effect append the data to the graph.  I hope this clarifies!

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 4 of 5
(3,691 Views)

I think that you are correct, I need to maintain a large array filled with all my data and timestamps, and then create a new Waveform<> object every time I plot data.

 

Thanks for the help!

0 Kudos
Message 5 of 5
(3,678 Views)