LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph using only a few elements of array

Solved!
Go to solution

Hi,

I am in "for loop", have array of elements(ex: 10) and doing some calculations.

Now i want to generate graph using this array. I can do it for all elements.

But i want to draw graph of only from Row 2 to 8 elements.

How can i?

Download All
0 Kudos
Message 1 of 6
(3,035 Views)
Solution
Accepted by topic author sacsk123

Hello,

 

insert "Array Subset" function into the array wire before the graph und set "index" and "length" input as needed.

 

Hope this helps.

UliB

Message 2 of 6
(3,011 Views)

Hi UliB,

This works like a charm.I didnt expect even after bundling arrays, we can select the start and end of array. Thank you for that.

Now,  little addition to this.

what if i have x-axis elements inside the "for loop" and y-axis elements are outside the for loop?

How to bundle these 2 arrays and draw graph?

The arrays and for loops confuse me a lot.

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

@sacsk123 wrote:

Hi UliB,

This works like a charm.I didnt expect even after bundling arrays, we can select the start and end of array. Thank you for that.

Now,  little addition to this.

what if i have x-axis elements inside the "for loop" and y-axis elements are outside the for loop?

How to bundle these 2 arrays and draw graph?

The arrays and for loops confuse me a lot.


You'll need as many X-elements as Y-elements - as i interpret your text it sounds like you'll end up with skewed arrays.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 6
(2,935 Views)

Hello,

your data type is 1D array of cluster of 2 elements, so you have to bundle your elements together and create an array (autoindexing).

I see you are using picture indicator to show the graph. I would use a XY Graph (not 2D picture), which can use a cluster of two 1D array as data type. In this case you would bundle X array and Y array after for loop together and wire it directly to XY Graph indicator.

 

Hope this helps

UliB

0 Kudos
Message 5 of 6
(2,917 Views)
Solution
Accepted by topic author sacsk123

Hi UliB,

In for loop,I was clubbing elements of 2 arrays using the "bundle by name" and come out of loop and use XY graph.This works fine.

But for this case(1 array inside the loop and other array outside the loop) - i just got both arrays outside the loop and used "Build XY graph". It worked for me.

 

Thanks for the help.

0 Kudos
Message 6 of 6
(2,908 Views)