LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Zooming a chart

Hello,

 

I am printing data from DAQmx card into a chart and I want to implement zoom future for the chart. As x axis shows time, I want to first value on x to be time when chart started to work, and most right value to be last printed value. So all ganareted values are shown on graph in same time. Second zoom would be second half of generated values. And third zoom last 1000 values.

 

For the first two zooms I have idea about how to do them, but... I tryed adding to property node minimum for x scale 0 value, but that sets it to year 1904... So I figure I need to get value of time when graph started working and that value to insert into property node minimum, problem is how to generate that tipe of time value so it works as minimum on scale. Once I do that  I can do same for second zoom, just find middle time between starting time and ending time, and put that into property node minimum.

 

I can get time (actually already doing that) when I start programm, but how to save it for later use when i press button for zoom 1? (off topic question and maybe a bit beginner question but I am a bigginer 😞 ) Should I use shift register to save value just on first iteration (when i for while loop is 0) and then use it when needed?

 

But for third zoom i dont really know how to implement that. Counting while loop iterations and save time each time counter generates new value beyond 1000 values? And write that into minimum.

 

If needed I can provide whole project so people can see what I am doing.

 

 

Thank you in advance! 🙂

0 Kudos
Message 1 of 4
(7,133 Views)

Are you working with charts or graphs?  Charts maintain a history, and that history is limited.  The default is the last 1024 points, but you can change that.  So you'll automatically get the last X number of points.

 

What do you mean by when the "chart started working"?   If you mean from when the program started working, you are talking an ever growing number of points.  How many might that be?

0 Kudos
Message 2 of 4
(7,123 Views)

As you mentioned, please supply the whole project so we can see exactly what you're working with.

 

You already know what a shift register is, so that's great! That's exactly what you would use if you need to store a value in memory from iteration to iteration, but you may not need this. The chart has a property called Chart History. This will give you all datapoint in the chart. That being said, by default it will autoscale to show all history so you main plot shouldn't need any alteration.

Cheers


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

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


0 Kudos
Message 3 of 4
(7,120 Views)

I am working with chart.

 

"chart started working" means when while loop that generates values starts working and generated values get printed on chart. Values are generated untill button is pressed, so infinit number of values. But chart is showing values from date (that I can edit in front panel), and untill last generated value.

 

I am attaching my project, I hope that you can test it (because it is working with DAQmx card) but at least you can see block diagram and see my logic. Ivana.vi is main program where I am making all the logic. If anything needs to be explained feel free to ask. And thanks for opening this thread and trying to help! 🙂

Download All
0 Kudos
Message 4 of 4
(7,101 Views)