LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to have XY Graph Interpret Multiple Plots From a While Loop

Solved!
Go to solution

I am a Georgia Tech undergraduate performing research on fabricated FETs, relatively new to LabVIEW, and I'm writing a LabVIEW vi to obtain output characteristics. Basically an Ids vs. Vds curve with a changing Vgs (curve tracer). I am controlling a power supply via GPIB to bias the gate, while using another power supply/meter via GPIB to vary Vds while obtaining Ids. My program currently works just as needed with one exception. After I construct my array of data, my XY graph interprets the data as one plot and during interpolation will connect all of data points together, as seen in the attached image. I would like the graph to interpret the data as multiple plots that way I can position cursors along each plot to obtain other parameters. I also attached my vi if needed. Any suggestions on how I can resolve this issue?

 

~jdamato3

Download All
0 Kudos
Message 1 of 13
(5,824 Views)

Hi jdamato3,

 

The XY Graph will plot a single plot or multiple plots depending on the how the data is constructed.  I would recommend looking at the following example:

 

1) Open LabVIEW

2) Click Help >> Find Examples

3) Click "Search" Tab

4) Search for "xy graph"

5) Open "XY Graph.vi"

 

If you can't find it, search for the following location (<labview>\examples\general\graphs\gengraph.llb\XY Graph.vi)

 

 

Regards,

 

 

Che T.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 13
(5,791 Views)

Thank you, but I think the problem lies in the way my data was constructed. Each iteration from the nested while loop concatenates into an array, so the XY graph interprets the data as a single set and during interpolation, just connects the dots. I'm trying to figure out out to have each iteration from my nested loop interpreted as an independent plot on the XY graph.

 

Thank you again for all of your help!

 

~jdamato3 

0 Kudos
Message 3 of 13
(5,782 Views)

It is much better if you would use complex data for xy graphs. Here's a simple draft how you would build a graph with N plots and M points/plot each. I am sure you can adapt it for your purpose.

 

(Even better would be to initilize full size plots with NaN and replace with real data as it arrives to avoid memory thrashing. Not shown)

 

You should also use "ramp by samples" to create your ramps outside the loops, and replace the while loops with autoindexing FOR loops.

 

 

Message 4 of 13
(5,776 Views)

Thank you very much for your reply! It was very helpful, but what is the purpose of using complex data points for an xy graph? How is that advantageous?

0 Kudos
Message 5 of 13
(5,749 Views)

@jdamato3 wrote:

It was very helpful, but what is the purpose of using complex data points for an xy graph? How is that advantageous?


It is cleaner because you avoid complicated data structures. A simple 1D complex array is easier to handle than an array of clusters containing x and y values. THe information is the same.

Message 6 of 13
(5,746 Views)

Thank you again! You have been so helpful. Sorry, one more question though. When you said, "(Even better would be to initilize full size plots with NaN and replace with real data as it arrives to avoid memory thrashing. Not shown)".

 

What exactly do you mean by initializing full size plots?

0 Kudos
Message 7 of 13
(5,743 Views)
Solution
Accepted by topic author jdamato3

Because you know from the very beginning how much data will be in the plots, you can initialize the final data structure once before the loops start. Now the size of the data structure in the shift register is invariant for the duration of the run. This is a good thing! 😄

 

In the earlier implementation, each array grows with each appended element and since arrays need to be contiguous in memory, each grow operation is likely to require a new copy of the entire data structure in memory. The program will spent most of its time doing memory allocations instead of real work. (no big deal here since the arrays are short, but imagine MBs of data and it will all become very expensive and slow).

 

Here is an example modification. (remember that data containing NaN don't show on graphs, thus giving the desired effect).

Message 8 of 13
(5,737 Views)

Thank you so much for all of your help!

0 Kudos
Message 9 of 13
(5,719 Views)

Hi everyone,

 

i hope someone to see this thread. I want to do the exact same thing with jdamato3, but i have labview 8.2 so i cannot open the vi. can someone please attach this vi in a version that i can open?

 

Thanks in advance

0 Kudos
Message 10 of 13
(5,359 Views)