01-27-2014 04:55 PM
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
01-27-2014 05:58 PM
Go to the example "Waveform Graph.vi" in the shipping examples. You just overlay two graphs together.
01-27-2014 06:10 PM
I agree that it would be much easier to do this with graphs than with charts.
Lynn
01-27-2014 09:30 PM
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.
01-28-2014 07:52 AM
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
01-29-2014 10:54 AM
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.
01-29-2014 12:26 PM
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.
01-29-2014 03:01 PM
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.