LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY Graph Multiplot Help

First off, sorry, I can't post my code here.  I did do a search and came up w/ no results that were helpful (but maybe my search criteria was not good enough).  I'm also a LabView newbie.  Anyway...

 

I'm attempting to create a XY graph multiplot.  Essentially, I'm trying to mimic the overlay feature of a Agilent PNA-X (Vector Network Analyzer).  I'm able to read the data and display both plots.  There are only 2 plots, both use the same X-scale (frequency) but they have different Y-scales.

 

Here are my current issues (sorry if some things aren't 100% accurate but I can't write this up from the computer where it's happening):

 

1) When I added the 2nd plot, only the 2nd plot flickers.

2) I can't seem to put up the 2nd plot's scale.  I did the "duplicate scale" but when I right clicked on it, the "swap scale" button was grayed out.

 

Could someone post a simple example as I've described above (2 plots on an XY graph, w/ different Y-scales and shown w/ no flickering) or provide some insight as to what I need to investigate.

 

TIA 

0 Kudos
Message 1 of 23
(7,082 Views)

You did not mention which version of LabVIEW but here is a very simple example in version 8.0.

 

Not sure what you mean by flickering. You will get a new display every time you read the instrument. Obviously, it would help if you could attach some code.

0 Kudos
Message 2 of 23
(7,067 Views)

Few things:

 

1) LabView 8.5

2) I "think" I may see a difference.  In my application, since the data is generated in a for loop, the first time, the array is passed to the XY graph.  In the next iteration of the loop, the original XY graph, is appended to the next array (using build array) and that is passed to the XY graph.  Is that the problem?  If so, how do I only get the array out of the original XY graph?

3) The example I've seen, but how do I programmatically set the Y-scale for both sides (and make the right side appear)?

 

TIA.

0 Kudos
Message 3 of 23
(7,031 Views)

Hi,

 

Is the XY graph within the for loop or outside?  Could you please clarify what you mean by "flickering"--is the graph not updating like you would expect, or is the whole LabVIEW front panel flickering?  

 

Also, if you could even just post a screenshot of your code, that would be helpful. 

 

Cheers,

 

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 4 of 23
(6,994 Views)

I cannot provide a screen shot for the same reason I cannot provide the code.  Only the 2nd plot is flickering (as in it's NOT a steady, slightly moving plot like the other plot is).  The rest of the screen is fine.  The plot line is as expected, it just flickers.  If the 2 plots are in separate XY graphs, there is no flickering.  Yes, the plot is in a loop (and multiple loops at that).  As stated earlier, one loop is to print out each plot (the first array is sent to the XY graph), then in the next iteration, the new plot array is appended to the original XY graph and sent to the same XY graph.

 

Also, I still need someone to post how to put up the 2nd scale (or 3rd or 4th) up programmatically.  The swap scale option is NOT available for some reason (I can duplicate the 1st scale but can't put it on the other side).

0 Kudos
Message 5 of 23
(6,985 Views)
Now I have a slightly different problem.  Each plot has its own scale.  However, when I assign values to the XY graph (like Yscale.minimum, Yscale.maximum) for each plot, the screen has to flash/flicker to change to the new scale.  I'd like each plot to have its own scale.  Instead of, within each plots loop, wiring the scale value to the XY graph, how do I make it so that each plot has its own scale?
0 Kudos
Message 6 of 23
(6,963 Views)

First, try swapping sides with the example I sent. If you can do that and can't on the VI you created, you are either doing something incorrectly, the VI is corrupt, or the graph is corrupt. The latter may sometimes be fixed by right clicking on it and selecting Advanced>Reset Scale Layout. If that does not do it, try replacing the graph. If you cannot do it on the example, try reinstalling LabVIEW

 

Second, your last question is confusing. You first state that each plot has it's own scale and then you ask in the last sentence how to make each plot have it's own scale.

 

You should probably not be writing to any property nodes with each iteration of a loop. You should only be writing when you need to. An event structure is often used for this. Further, you can use the Panel property called Defer Panel Updates to set a lot of properties at once and then do the update only once. Also, in order  to change one scale and not the other, you have to specify the active X scale or active y scale that you want to modify. 

0 Kudos
Message 7 of 23
(6,945 Views)

What I meant to say was each intended plot has a different scale.  I wrote each of the different scale values (like Yscale.minimum) to the same XY graph in each iteration of the loop (an iteration of the loop adds the array to the XY graph and also sets that plots scale values, then I go on to the next iteration).

 

How do I specify the active Y scale?  Can you please provide a coded example?

 

Swap Sides works on the example.  I noticed that when I did the Swap Sides on the example that the scales weren't overlaid (they were side-to-side).  On my graph, they are right on top of the other (this MAY be due) to the fact that I'm setting the scales manually/programmatically???

 

I will try to write up some text notes and then try to recreate a simpler version so that I can show you what is happening.

 

 

0 Kudos
Message 8 of 23
(6,911 Views)

Set Active Scale.PNG

 

Set either the active X or active Y scale with the appropriate property node.

0 Kudos
Message 9 of 23
(6,896 Views)

Here's something pretty close to what I'm doing now.  So the basic principle is that there are 3 plots here.  1 built separately (XY graph 2), and 2 built within a loop.  What I'm having a difficult time comprehending is how to build the initial (the plots in the loop) into separate bundles to be input into Build Array.

 

In the real program, there are 4 plots within the loop (plus the additional one similar to XY graph 2).  XY graph 2 will always have the same scale as one of the plots.

0 Kudos
Message 10 of 23
(6,862 Views)