Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

PlotWaveformsAppend shows no data after setting X-Axis as a time axis

I have an WaveFormGraph that I would like to configure as a time vs Y strip chart. 

 

- I initialized the plot X Axis Range with:

 

    myPlot.Range = New Range( DateTime.Now, TimeSpan.FromMinutes( 15 ))

  myPlot.DefaultStart = DataConverter.Convert(Of Double)(DateTime.Now)

  myPlot.DefaultIncrement = DataConverter.Convert(Of Double)(TimeSpan.FromSeconds(1))

 

- Data is being pumped to the WaveFormGraph with a PlotWaveformsAppend in the callback method of my application.

 

- When I run the application, no data appears on the WaveFormGraph.

 

- If I remove the calls used to initialize the X Axis Range, data appears on the WaveformGraph; but the x-axis shows a sample count.

 

Is there a way to do a strip chart where the X Axis shows elapsed time?

0 Kudos
Message 1 of 3
(4,002 Views)

Hi DKIMZEY, 

 

Let me look at this a little bit, in the mean time you may want to look at the techniques in the examples:

 

<National Instruments>\MStudioVS2010\DotNET\Examples\UI\WindowsForms\Graph\PlotWaveforms

 

Jesse Dennis
Engineer
INTP
0 Kudos
Message 2 of 3
(3,991 Views)

Hello there, here are some tips that can help you to solve the issue,

 

1. The XAxis displays the tick labels depending on the FormatString used for the XAxis.MajorDivisions.LabelFormat property. (Setting the Range by using the constructor that takes DateTime parameters does not set the axis labels to be in time formats)

 

2. Check the XAxis.Mode property on the axis. This will decide the range on the XAxis while plotting data. The Axis.Range also depends on the Plot.DefaultStart and Plot.DefaultIncrement when data is plotted on the graph.

 

See if in your code XAxis.Mode is set to Fixed.

 

3. You might also want to make sure that the Graph has enough buffer to copy the data in case you are plotting huge amounts of data. This done by setting WaveformPlot.HistoryCapacity. If the data exceeds this amount then graph keeps only the latest data.

 

I hope these tips are helpful. If you are still facing the same issue, you could provide a sample project with minimum code that would reproduce this issue. This will help us solving issue you are encountering.

 

Vijet Patankar

National Instruments

0 Kudos
Message 3 of 3
(3,985 Views)