08-18-2009 09:25 PM
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
08-18-2009 10:21 PM
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.
08-19-2009 11:49 AM
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.
08-20-2009 10:04 AM
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,
08-20-2009 12:24 PM
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).
08-20-2009 07:42 PM
08-20-2009 08:30 PM
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.
08-24-2009 12:47 PM
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.
08-24-2009 01:14 PM
Set either the active X or active Y scale with the appropriate property node.
08-24-2009 04:42 PM
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.