LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an easy way to put markers dynamically on a waveform chart?

Hi all, so I have a waveform chart in my program. It is inside a loop, and each iteration of the loop, about 5000 data points are taken and plotted to the chart, such that they're appended, so the entire history (over many iterations) is visible in the chart.

 

What I'd like to do is be able to put some sort of marker, maybe just a bright vertical line, in the waveform chart, every time one of those iterations end, so that once a bunch of iterations have passed, the ranges in the waveform chart corresponding to the data taken in the different iterations are still apparent. And obviously, I'd like the vertical bars to move with the data as new data is added (because I'm in the "strip chart" update mode).

 

Ideally also, I'd be able to plot a horizontal bar as well, but only in a limited x-axis range, at the height of the mean for each given data range (for example, if the data taken for one iteration ran from t = 5000 to t = 10000 and the mean was 3.0, there would be a horizontal line at height 3.0 on the chart, running from t = 5000 to t = 10000).

 

Is there a way to do either of these things?

 

thank you!

0 Kudos
Message 1 of 4
(4,051 Views)

Sounds like you want to use cursors, but you can't use cursors on a Chart. If you really need this functionality, you could either switch to a Graph to use cursors, or you could add another plot to your chart and generate a spike of data to match your needs (or a constant value dataset for horizontal).

I've used an added plot to my charts before for very similar functionality. My data followed a threshold functionality, so it would either trigger or not-trigger an output. To show this, I added a "Trigger" plot to my indicator that had a fill-from-zero look to it. Whenever there was a threshold passed, I would bring the value of that plot to the Max value on the chart. It worked pretty well. In your case, you might want to just do a couple of points to show a vertical line from Min to Max.

 

Some resources for cursors:

http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/adding_cursors_to_graphs/

http://digital.ni.com/public.nsf/allkb/280875F12A53D4FD8625699E006F0BBA

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 4
(4,045 Views)

To plot the mean, just create another plot that does not show up on the Plot index and make all of its points "the mean".  I do something like this -- I have N data plots, all "stacked" (that is their origins are offset vertically so I see N "traces", but don't know where each Trace's "zero" is).  I create another N plots, set them up to match color of the corresponding plot N earlier, make the line thinner (so it's less obtrusive) and plot it as well.  In my case, I'm plotting 20 points/second, so I just plot them as they come, one point at a time.

 

Bob Schor

0 Kudos
Message 3 of 4
(4,012 Views)
This may sound like going the long way around the barn, but I would consider using an xy graph and play with the data so it LOOKS like a chart.

Then what you want to do will be a piece o' cake -- or as easy as pie -- depending upon your dessert preferences.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 4
(4,006 Views)