LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic graph origin on xy graph

Solved!
Go to solution

Hi all,

 

I'm trying to get my origin of my xy graph to be dynamic more like the "waveform chart" function in labview. Otherwise the plot will get too small and crowded as I'm planning on running the programm for a longer time. Unfortunately the "waveform chart" function doesn't work if I use the "index function" and I quite like the idea of having the elapsed time on the x-axis and not the current time.

 

Many thanks!

0 Kudos
Message 1 of 7
(878 Views)

Hi jolli,

 


@jolli12 wrote:

I'm trying to get my origin of my xy graph to be dynamic more like the "waveform chart" function in labview. Otherwise the plot will get too small and crowded as I'm planning on running the programm for a longer time.


You are using a XYGraph, so I see two options:

  1. instead of putting the complete XY data in each plot you might create the plots from subsets of those arrays
  2. switch off X axis autoscaling and set the X axis min/max as needed using property nodes
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(873 Views)

Hi Gerd,

 

 

switch off X axis autoscaling and set the X axis min/max as needed using property nodes


your first proposition sounds like something I'm looking for, but how do I create these subsets. I would probably like to showcase the latest 20-30 points/entries of the array. 

 



instead of putting the complete XY data in each plot you might create the plots from subsets of those arrays

I'm not too sure about that, because then the x-axis would be set and couldn't move anymore?

 

Thanks!

0 Kudos
Message 3 of 7
(867 Views)

Hi Gerd,

the first one actually works quite well too! A very basic question, but how as you can see when the time goes on the plot gets bigger, but the viewer still sees the origin and not the current temperature of the plot, he would need to scroll down for that. Is there a solution on how to always see the current state and not the past state?

Thanks!

0 Kudos
Message 4 of 7
(856 Views)

Hi jolli,

 


@jolli12 wrote:

your first proposition sounds like something I'm looking for, but how do I create these subsets. I would probably like to showcase the latest 20-30 points/entries of the array. 


When you want to show the most recent samples then you need to use a subset of those most recent samples…

(The way you build your arrays you might need to take a subset at the end of the arrays.)

 

You forgot to attach your latest code, but only attach a small image showing the frontpanel: what kind of help do you expect for your code problems?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 7
(838 Views)

@GerdW wrote:

When you want to show the most recent samples then you need to use a subset of those most recent samples…

(The way you build your arrays you might need to take a subset at the end of the arrays.)


I have tried to do that, but somehow my Array seems to be recognized as 1D here, as i can't control columns or rows. Furthermore I wouldn't know how to only access for example only the last 20 entries of the array.

 


@GerdW wrote:

 

You forgot to attach your latest code, but only attach a small image showing the frontpanel: what kind of help do you expect for your code problems?


For that part I didn't change anything in the code, as attached on the other snippet. I only showed the x scrollbar and turned off autoscale. That would almost do what I'm looking for. But the user has to actively scroll up to get the current temperature.
This last approach seems easier to me, but I don't know how to fix that bug that I don't have to scroll but the programm does it "automatically" for me.

 

Thanks!

Download All
0 Kudos
Message 6 of 7
(823 Views)
Solution
Accepted by topic author jolli12

Hi jolli,

 


@jolli12 wrote:
Furthermore I wouldn't know how to only access for example only the last 20 entries of the array

One possible solution:

You could also change the order how you build your arrays by prepending new elements instead of appending. Then a simple ArraySubset getting 20 elements starting from index 0 would be fine…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 7
(815 Views)