LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

One graph palette for two/several plots

In the attachment you can find a simple example VI in which I use two XY Graphs to display some data.

Both plots should behave in the same way. E.g. if the “First Graph” shows only the red line, the “Second Graph” should do this automatically too (so that the user only has to use one “Plot Legend”).

I could achieve this behavior by using the property nodes of the XY Graphs.

 

Similarily I want to have only one “Graph Platte” which works for both XY Graphs. So, if the user uses e.g. the magnification tool, the tool should do the same action on both graphs (it should behave similar as the trick I use for the “Plot Legend”).

Unfortunately, I did not find a solution for this problem so far.

 

There is a similar question here (http://forums.ni.com/t5/LabVIEW/How-to-detect-a-user-action-in-the-graph-palette-with-an-event/m-p/2...), but the solution is not clear enough to me.

 

Therefore, I would be very happy if someone could help me or give me some hints!

0 Kudos
Message 1 of 14
(3,278 Views)

Hey Partial81,

 

I couldn't open your attachment as I don't have LV 2012 installed. But I kind of understood what you are trying to do. Have a look at the attached vi which will help you get started. I have documented the block diagram so that you can understand how the events are handled. Try changing the graph palette tools, stretching the plots, shrinking it, changing plot color, etc. You will see the actions done in all the graphs automatically. 

 

Regards,
Nitz

(Give Kudos To Good Answers, Mark it as a Solution If your Problem was Solved ;))

Message 2 of 14
(3,243 Views)

Nice example, Nitz.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 3 of 14
(3,221 Views)

You mean like this?

 

You need to disable autoscaling on both of your graphs or the zoom will be reset by the autoscale function.

 

autograph.png

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 14
(3,207 Views)

Thanks Cameron.. I was curious to see how it works when I read this post.. So I quickly created the vi and posted it over here.. 🙂 

 

Hope it helps partial81 🙂

 

regards,
Nitz

0 Kudos
Message 5 of 14
(3,190 Views)

Dear NitzZ,

 

Thank you for your efforts and the well commented code! Your code does almost the things I want.

I only have the following problems:

1: If I chose one of the tools of the Master Graph and if I use it then for Graph 2 or 3, then the tool does not work; the tool I used last will be used. If I select the new tool for the second time, then it is used in the correct way.

2: I like it much that you can use for Graph 2 or 3 the same tool and choose in these plots different regions of interest. But If I do not make any changes for the Master Graph, then it is impossible for me to maximize Graph 2 or 3 (see attached picture).

I tried to solve these problems by myself, but so far I failed. Perhaps you or somebody else has a solution for them.

 

P.S.: I added my code for LV 2009 (but you will not need it ;-).

0 Kudos
Message 6 of 14
(3,169 Views)

Dear RTSLVU,

 

Thank you for your approach. I like that your code seems to be simple. But unfortunately it does not exactly what I want:

If I use one of the graph palette tools, then the tool will work for both graphs, only when I use it on the First Graph. If I try to use it on the Second Graph, it does not change anything. With your code the user has to know that the tool can only be used for the First Graph (and works then for both graphs) and not for the Second Graph – this is something I want to avoid.

I tried to improve your code, but I also failed there. Perhaps you have an idea how it can be fixed.

0 Kudos
Message 7 of 14
(3,168 Views)

Hey Partial,

 

Check out the attached vi. I have edited the previous day's code. I have fixed the first issue which you told and have enabled the graph palette for your 2nd requirement. Hope it helps. I didn't have much time and so couldn't check if it is the best solution but yes, you can try it out and explore more.. 😉

 

regards,
Nitz

(Give Kudos To Good Answers, Mark it as a Solution If your Problem was Solved :smileywink:)

Message 8 of 14
(3,138 Views)

Hey Nitz,

 

Thank you again for your help!

Your code works almost perfectly!

I adapted it slightly to my needs (see attachment), but there is still one old problem remaining:

If I choose “Zoom to Fit”, it only works for Graph 2 if I made some changes to the Master Graph (see also picture in my last reply to you).

 

I think the problem is not your code, I fear that there is a LabVIEW bug. I added a sequence structure to your code to read in some value for the property node and to read this value back from the property node. This works well for numbers 0 to 4 (0 is the selection cursor, 1 is the panning tool, 2 is Zoom to Rectangle, 3 is X-zoom, 4 is Y-zoom) and for number 6 (Zoom Out about Point) and 7 (Zoom In about Point), but not for number 5 (Zoom to Fit)!

Since it does not work for number 5, it cannot work in your nice program.

 

Regardless if this is really a bug, I would be happy to find a workaround for this problem. Perhaps you can find some time to help me again.

Download All
0 Kudos
Message 9 of 14
(3,120 Views)

I found here another question which is related to my one:

http://forums.ni.com/t5/LabVIEW/Can-a-Vision-image-display-s-quot-zoom-to-fit-quot-action-be/m-p/171...

 

It seems that there is an image window property node for the zoom to fit option which has a Boolean output. This could be a helpful tool to solve my problem. But I cannot find this property node.

Can somebody tell me how I can create this special property node?

0 Kudos
Message 10 of 14
(3,104 Views)