LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Overlay serial data over stored waveform in waveform chart

Hi all,

 

I have a PIC18 sampling and transmitting ADC data (10-bit) via UART at roughly 1,000 samples/s at a baud rate of 19,200 bit/s. I have no issues with plotting this data in "real-time" via a waveform chart.

 

I have a desired waveform that I have generated in LabVIEW and I would like to be able to superimpose my serial data over top of this waveform within a waveform chart. Essentially I have a potentiometer varying the sample value on the PIC18 ADC and I would like to be able to trace the generated waveform (in LabVIEW) with this transmitted data.

 

Attached is an image of what I am trying to accomplish. The red trapezoid waveform is the generated waveform and the black trace is the incoming serial data that I am varying with the potentiometer (trying to mimic the red waveform).

 

Any advice is greatly appreciated.

 

Thanks,

J

0 Kudos
Message 1 of 8
(3,369 Views)

Go to the example "Waveform Graph.vi" in the shipping examples. You just overlay two graphs together.

0 Kudos
Message 2 of 8
(3,336 Views)

I agree that it would be much easier to do this with graphs than with charts.

 

Lynn

0 Kudos
Message 3 of 8
(3,327 Views)

I'm not sure how making both plots stationary will help my particular situation. This needs to be done with a waveform chart as new data is constantly being fed in.

0 Kudos
Message 4 of 8
(3,310 Views)

Hi pj1390!

 

In the forum I am linking, you can see how Wes_3DO was suggested to show two plots overlaying, in the same graph.

 

http://forums.ni.com/t5/LabVIEW/Graph-Excel-data-with-dynamic-data-acquisition-overlay/td-p/2353074

 

I think it can help you,

 

please let us know

0 Kudos
Message 5 of 8
(3,281 Views)

Another approach might be to write code to make a graph behave like a chart. Make a single-iteration while loop with a shift register containing a 1-D array of a certain size, say 100 points. With a new incoming value, rotate the shift-register array by 1, replace the value at index 0, and wire it back into the shift-register. To plot it, just tee off the array, reverse the array, and wire it to a graph.

0 Kudos
Message 6 of 8
(3,246 Views)

Thank you for the response.

 

That would work but it is not quite what I need. I would need the plot to have at least 5 seconds worth of data displayed at a time and waiting for the graph to update each time would be quite slow and choppy unforunately. The whole interface requires the user to have real-time visual feedback of how well they are tracing the static waveform.

0 Kudos
Message 7 of 8
(3,231 Views)

No, the graph would update with each new incoming data point, displaying the most recent set of X data points. The update behavior would be the same as a chart.

0 Kudos
Message 8 of 8
(3,212 Views)