LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic waveform questions

Hi Folks,

 

I recently started working with some waveform data types and have some basic questions. First and foremost, in the 'Get Waveform Subset' example, a subset plot is overlayed with the original plot. Does the correct synching of the overlaid plots rely on "calculated" X points (via t0 and dt), or are there placeholders for each 'unplotted' point? I hope this makes sense...

 

I've roughed out a quick application that aquires samples from a cFP at 100Hz, places it in an array, and builds a waveform. It then takes a 'rolling' group of ten samples and queue's it to processing.

 

Processing decides what to do based on the slope of a linear fit. If it fits the criteria, it retains these data points. I need to overlay these so the user can visually see what data is being deemed 'valid'.

 

My problem is how to overlay the points I'm interested in onto the original plot. The attached screenshot should help. I'm trying to overlay Original Graph with Valid Graph. I have attempted to simply build an array of both (using a local variable) but the plots do not synch on the graph. I'll try to attach a screenshot showing this as well.

 

PS the other boolean case in the consumer loop is a pass-through for the shift register.

 

Thanks for any help you can offer!

 

v2009 devel. w/RT
0 Kudos
Message 1 of 5
(3,363 Views)

Attached are three waveform screenshots in order. The red plot on the 'overlayed graph' will move back and forth (this was created by building an array from both 'Original' and 'valid', as mentioned above).

 

Obviously this is a timing issue, but I thought i was circumventing that by taking the timing attributes from the original waveform. Any thoughts on how to get this to work properly? Please, don't hesitate to critique.

 

Happy Wiring,

Jamie

Message Edited by 8bitbanger on 12-23-2008 01:14 PM
v2009 devel. w/RT
Download All
0 Kudos
Message 2 of 5
(3,358 Views)

Hello!

 

Thank you for contacting National Instruments!  I have looked through your post and I believe I may have found some documentation that will help get you started in the right direction.  Feel free to take a look at this Knowledgebase Article that talks about stacking plots on a Waveform Chart.  You can also store the data for the second Waveform as an array of doubles, and then you can build up the Waveform specifying the same t0 and dt as the original Waveform (as long as they have the same number of data points).  This will remove the specific time values that were stored into the second Waveform and utilize the t0 and dt values for the original Waveform.  Please let me know if you have any further questions on this issue and I will be happy to assist you.  I hope this helps!  Have a great day!

Thanks!
Bob H
Applications Engineer
National Instruments
0 Kudos
Message 3 of 5
(3,322 Views)

Hi Bob - thanks for the response.

 

Regarding one of your statements: "as long as they have the same number of data points". If this is the case, how does the 'waveform subset' NI example work? What values are they populating as 'filler' for the unused data points?

 

To sum it up, I have two sets of data points, for sake of argument we'll say they have the same dt and d0. Shouldn't I be able to overlay a subset, relying solely on the timestamp of each data point?

 

Jamie

v2009 devel. w/RT
0 Kudos
Message 4 of 5
(3,276 Views)

Hi Jamie,

 

There is a property for the chart named "Ignore Attributes" that must be FALSE (NOT checked) if you want the chart to plot the data based on the t0 and dt contained in the waveform. The Waveform data-type version of the Chart behaves differently from other versions of the Chart. Provided your chart is configured to use the attributes you should be able to present an array of Waveforms (one element for each plot) to the chart and the data will be plotted based on what it is given.

 

Notes:

1) If you increase or decrease the number of elements in the array presented to the Chart (you go from one plot to two...) the chart will reset it self and start over plotting new number of traces.

 

2) If you present data such that its t0, dt and Y values that over-lap what is already displayed or is older, the chart will reset.

 

3) If the Waveform presented to the chart only has a single value in the "Y" array, t0 will be used to plot the single point.

 

4) You can have a different number of data points in each of your plots provided none of the above rules come into play.

 

5) If you have multiple plots and you have new data for one plot but nothing for another trace, make sure the "Y" array for that plot is empty.

 

6) If you want to break the plot line (lift the pen), then you can use "NaN" in the Y array since LV does not where NaN is located on the chart.

 

For some examples search this site for "Waveform Chart" and you should find examples from myself Christian and Chilly Charlie at the very least.

 

Have fun!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 5
(3,261 Views)