03-03-2014 04:51 PM - edited 03-03-2014 04:55 PM
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!
03-03-2014 10:44 PM
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 ;))
03-04-2014 07:11 AM
Nice example, Nitz.
Cameron
03-04-2014 09:42 AM - edited 03-04-2014 09:43 AM
You mean like this?
You need to disable autoscaling on both of your graphs or the zoom will be reset by the autoscale function.
03-04-2014 01:58 PM - edited 03-04-2014 01:59 PM
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
03-05-2014 01:24 AM - edited 03-05-2014 01:25 AM
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 ;-).
03-05-2014 01:25 AM
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.
03-05-2014 01:34 PM
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 )
03-05-2014 05:23 PM
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.
03-06-2014 01:02 AM
I found here another question which is related to my one:
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?