LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I programatically change the number of points shown on the X-axis of a waveform chart?

Solved!
Go to solution

Hello everyone,

 

I am trying to add a control to a waveform chart that will allow me to change the number of points displayed on the X-axis. The chart is updating every half a second and currently it shows the most recent 20 points of data (I did this by right-clicking the chart and unchecking the "autoscale" box and entering 0 for the minimum and 20 for the maximum). I would like to be able to enter in how many points I would like to see, whether that be 20, 50 or 116 etc etc.  I have tried using property nodes to set the X minimum and X maximum but that causes the graph to flash back and forth between displaying that fixed points in time and the current data.

 

I don't just want to view a range either (defined by a min and max), I want to set the number of points to be displayed so that the plot will retain it's real-time updating like it does by default, but showing the the most recent <number of my choosing> points of data. 

 

My source code is quite messy at this point, but if this isn't an easy fix and you need an example, I might be able to put something together.

 

Thanks in advance,

-Aaron

0 Kudos
Message 1 of 6
(3,206 Views)

Ok, here is some example code. Hopefully this will help you understand my question better.

 

-Aaron

0 Kudos
Message 2 of 6
(3,198 Views)

Hi Aaron,

 

If you want to see the most recent n samples in your chart while n can be modified during runtime, than I might have a solution for you...

 

Please check out the modified VI.

 

 

Regards,

Thomas

0 Kudos
Message 3 of 6
(3,187 Views)

I'm sorry, I should have mentioned that I have labVIEW 8.5.1. Do you think you could save the .vi as an earlier version? or take a screenshot?

 

Thank you!

0 Kudos
Message 4 of 6
(3,184 Views)
Solution
Accepted by topic author AaronMcCollough
the modified VI saved for LV85...
Message 5 of 6
(3,182 Views)

Yes! That works perfectly, this is exactly what I was looking for!

 

Thanks!

0 Kudos
Message 6 of 6
(3,177 Views)