LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

xy data in array to xy chart

Solved!
Go to solution

Good afternoon, gentlemen.

 

I have some data in 2 columns of an array, and I wish to plot the first column as the x axis and the second column as the y axis.  The way I have found to do this is separating the two columns and using the "Build XY Graph" express vi, as indicated below.  However, I find this unpleasant and ugly.  Is there a better way to do this?  Ideally, I would like to keep the data together, without separating it, and I don't want to use a bulky "express" vi.

 

Thanks in advance.

 

 

0 Kudos
Message 1 of 9
(17,000 Views)
Solution
Accepted by topic author inlkjlkj

try this:

 

 

Simply slice out the two columns and bundle them. Make sure to wire the index to the lower terminal of the two to get columns instead of rows.

Also note that Index Array is resizeable, so you only need one instance.

 

(If you want two rows, you don't need to wire any indices to index array).

Message Edited by altenbach on 01-22-2010 12:31 PM
Message 2 of 9
(16,963 Views)
Much cleaner.  Thank you very much, sir!
0 Kudos
Message 3 of 9
(16,955 Views)

@altenbach,

 

what is that box between the "Insert into Array" and "XY Graph" boxes? also, does it slice row from row or column from column?

0 Kudos
Message 4 of 9
(15,948 Views)

That's not Insert Into Array. It's an Index Array and as mentioned, the other function is a Bundle.

 

The Index Array can retrieve a row, column, or individual element.

Message 5 of 9
(15,940 Views)

I'm finding a problem with this! please can you help me out! 

 

Thanks! 🙂

Message 6 of 9
(9,368 Views)

@kashyapvelpuru wrote:

I'm finding a problem with this! please can you help me out! 

You are using a waveform graph instead of an xy graph.

 

(To get better help, please attach the actual VI instead of a blurry picture. There are several other things wrong in your VI. Building a scalar into an array of lenght zero seems silly. Do you really only want to graph the last point?)

0 Kudos
Message 7 of 9
(9,353 Views)

I've got one two set of values temp and time, I need to plot temp in Y axis and time in X axis! 

I'm a beginner and please help me with some short cuts and tips too! 🙂

Thanks @ altenbach! 

0 Kudos
Message 8 of 9
(9,346 Views)

What determines your loop rate?

 

If the time points are equally spaced, all you need is a plain chart for the temperature. Set x0 to the current time at the start of the program.

 

If the time points are not equally spaced AND accurate time is required, you would build an array of accumulated data in a shift register. However, you should make sure that the size remains finite (e.g. the last 1000 points) so you will not run out of memory. You "initialize array" functions make no sense.

 

(As a cheap workaround, you could use the "built xy graph express VI" and have it retain data between calls. Not recommended).

 

What is the format of your received string? All you probably need is a simple scan function getting the values using decimal and time formats. Simplify!

 

Obviously you have virtually no LabVIEW experience, so I would recommend doing a few tutorials first. Why is your array indicator EXT leading to a coercion dot? Why is there no error handling?

0 Kudos
Message 9 of 9
(9,337 Views)