# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Periodically iterating through a 2D column array and plotting the data per iteration

Hi,

I am attempting to plot data that's read from a spreadsheet, but rather than plot the data all at once, I am looking to plot the data in 1 - 2 second portions as I iterate through my array. The idea is to create a plot that would slowly fill itself with new portions of array with each iteration.

I have included the VI in-question, along with the spreadsheet and an image of the figure I am trying to plot. Just for reference, the VI was borrowed and adapted from the thread "Read Data from Spreadsheet (.csv) and Display in LabVIEW" by SpaceHunter.

Omar

Message 1 of 5
(1,003 Views)
Solution
Accepted by topic author OmarOmari

## Re: Periodically iterating through a 2D column array and plotting the data per iteration

• Your main problem is the use of autoindexing at the FOR loop. With each iteration, you are only getting one column, so on the first iteration, you are getting the first column (since you transpose first), and taking one subset and on the next iteration, you are getting a different subset from the second column. now the loop stops, because you have run out of columns. (No matter what you wire to N!)
• To incrementally plot the data, you need to take evergrowing subsets starting at zero.
• Things are much simpler when using a 1D complex array for the xy data.

Attached is a quick draft. Modify as needed.

(Since your x=values seem to be about equally spaced (are they?), all you need are waveform graphs. You can set x0 and dx accordingly, simplifying the code even more. Not shown.)

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 2 of 5
(977 Views)

## Re: Periodically iterating through a 2D column array and plotting the data per iteration

Also note that your csv file contains three non-pritable characters at the beginning. (EF BB BF in hex). You might want to investigate their origin and meaning.

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 3 of 5
(968 Views)

## Re: Periodically iterating through a 2D column array and plotting the data per iteration

Thank you so much for your prompt response! Worked out great! 🙂

Message 4 of 5
(950 Views)

## Re: Periodically iterating through a 2D column array and plotting the data per iteration

Thanks for the heads up! Really appreciate the support.

Message 5 of 5
(934 Views)