From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Solved!
Go to solution

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.

 

Thanks in advance!

Omar

Download All
0 Kudos
Message 1 of 5
(2,037 Views)
Solution
Accepted by topic author OmarOmari
  • 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.)

Message 2 of 5
(2,011 Views)

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.

0 Kudos
Message 3 of 5
(2,002 Views)

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

0 Kudos
Message 4 of 5
(1,984 Views)

Thanks for the heads up! Really appreciate the support.

0 Kudos
Message 5 of 5
(1,968 Views)