LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

overlap signals in waveform graph

Hi,

There's a gap between the two graphs. Does anyone have any idea how to close that gap? It's shown in the image below:graph gap.PNG

 The vi is attached also. Thanks for helping!

 

0 Kudos
Message 1 of 10
(3,577 Views)

First of all I'm missing your plot. Second of all just make 2 plots in stead of the amount that you have now. As first a green plot and secondly a red plot. Make the values of the green plot, where only the red plot should be visible, NaN. Do the same (NaN for the red plot values) when the green plot should be visible. This makes it more simple and should resolve your issue.

0 Kudos
Message 2 of 10
(3,539 Views)

Hi Ben,

 

- unfortunately your VI is not executable as it is missing several type definitions and a XY graph as well!

- it also doesn't help when you don't provide meaningful example data.

- it seems "interesting" you initialize the shift register holding the plot number with zero, but then decrement its value in each of the cases. What are the plots "-1", "-2",…???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 10
(3,537 Views)

My bad, I had 2 vis labelled test1, here's the correct vi.

0 Kudos
Message 4 of 10
(3,507 Views)

Put all your code in one For Loop.

 

Each plot needs to include the point where you make the change from green to red.  You need a point where the green will end, and a point where the red will begin.  And vice versa.

 

So when you go to hide a slide, first determine if you are going from a green to red point.  On the point where you make the change, plot both values.  On any consecutive slice after that, put NaN in either the red or the green.  When it switches back, put points in both plots, and then NaN, in either the green or red.

0 Kudos
Message 5 of 10
(3,500 Views)

Hi Ravensfan,

 

I'm not sure what you mean by hide a slide. Are you talking about the overlap between the 1's array and the NaN's array?

Yes, the idea is to include the point where the two arrays merge in both plots but I'm not sure how.

 

Thanks!

 

0 Kudos
Message 6 of 10
(3,492 Views)

Actually, I meant hide a "slice".  I must've mistyped.

 

Let's say your array is 1 2 3 4 5 6  and you want 3 and 4 to be hidden.  Then you need your green plot to be

1 2 3 NaN 5 6

 

Your red plot to be:

NaN Nan 3 4 5 Nan

 

So where you transition from shown in slice 2 to hidden in slice 3, you need 3 to be in both arrays, then start doing NaN in the green array.

And when you transition from hidden to shown starting at slice 5, then you need 5 to be in both arrays and start doing NaN in the red array.

0 Kudos
Message 7 of 10
(3,488 Views)

I thought that's what the 2 loops were doing, the top replaces the slices to be ignored with NaN's in an array of 1's and the bottom does the opposite for the same slices. Now, when the dt is small it appears continuous. It's considering both slices but it appears to be stopping a few points short/starting a few points after each slice. to illustrate, here's an image of the graph with a smaller dt(0.01):

small dt.PNG

Thank you for your help! 

0 Kudos
Message 8 of 10
(3,464 Views)

No.

 

Your one loop will give 1 2 NaN Nan 5 6

Your other gives  NaN Nan 3  4 NaN Nan.

 

They are either/or.

You need to have a given point be "active" in both plots.

So it needs to be:

1 2 3 NaN 5 6

NaN Nan 3 4 5 Nan

 

3 exists in both and 5 exists in both so that it can END the one plot with a complete line while the next plot begins.

0 Kudos
Message 9 of 10
(3,447 Views)

Hi ravensfan,

 

I modified that vi. Could you give me some feedback on whether this vi could be simplified further or if it could be done in a different way?

 

Thank you for your help!!

0 Kudos
Message 10 of 10
(3,427 Views)