LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding to array of clusters and displaying them all in a XY graph

Solved!
Go to solution

Hi there,

 

I've ran into an issue when trying to add another array to a cluster of arrays. Wondering if anyone has any pointers.

The program takes all the readings from the spreadsheet file and is meant to graph them all with different colours to differentiate which piece of data it is. I got it working when all the lines are the same colour but when trying to split each set of data into its own array it now only displays them one by one and saves none of them.

I have attached the VI and spreadsheet.

 

Excuse the mess of wires I'm pretty new to all this LabVIEW stuff, and the end condition is just a placeholder for the time being

Download All
0 Kudos
Message 1 of 7
(2,170 Views)
  • All you are doing is appending to an empty diagram constant in each TRUE case. That operation is pointless, because it returns the lower array unchanged.
  • Index array is resizeable.
  • Your outer while loop is a glorified FOR loop (fixed iterations known before the loop even starts. It should be a FOR loop)
  • Shouldn't the number of iterations depend on the data size?
  • Why is the diagram maximized to the screen, but such a mess. (overlapping & hidden items, tons of wire bends, etc.)
  • You cannot guarantee that the reinit to default executes before the loops because there is no data dependency. It is also not needed (you can configure the VI to clear indicators when called).
  • Your file contains many columns but you only ever look at the first two. What exactly are you trying to display?
  • What is the purpose of the comparison and case structure?
  • To append data, you typically would build the data structure in a shift register? Ever heard of them?
  • XY graphs understand complex 1D arrays. Might simplify your code dramatically (e.g. no clusters needed).

Can you explain what you are trying to display and what you like to see at the end (one long plot? one plot for each column?)

What is X? What is Y?

0 Kudos
Message 2 of 7
(2,159 Views)

I just clocked I uploaded the wrong file, I uploaded an older version by accident. The X is the time and the Y is the CO in the spreadsheet

0 Kudos
Message 3 of 7
(2,153 Views)

I want to display each set of data between each of the NaN values in the spreadsheet as their own plot, each with a different colour

0 Kudos
Message 4 of 7
(2,149 Views)
  • Your shift registers need to be initialized.
  • Any comparison (or search) with NaN might not return what you think.
  • Your inner FOR loop seems pointless. In only runs once anyway. Why not anchor the shift register in the outer loop?
  • You are still appending to an empty array diagram constant (a NOOP). You should append the new data to the data in the shift register instead.
  • Your diagram is still maximized to the screen. Very annoying. I don't want to stare at a huge white area preventing me from looking at anything else.
0 Kudos
Message 5 of 7
(2,138 Views)

See if this gives you any hints (like using Autoindexing Tunnels).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Download All
0 Kudos
Message 6 of 7
(2,135 Views)
Solution
Accepted by topic author IHaveArms

Here's one possibility:

(first loop eliminates NAN lines and such. Second loop builds each graph, starting a new one whenever the X is nonascending)

 

 

xygraph.png

Message 7 of 7
(2,127 Views)