LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to select which plots are visible

Solved!
Go to solution

I want to be able to make one of two plots visible OR make both plots visible at the same time depending on front panel controls.  With the attached vi I can make either plot visible.  How do I make both visible at the same time?  Ultimately, I would like to expand this featue to more than two plots with any number visible at once.  For example, I might want to make 3 out of 4 plots visible or all 4 at once.

 

Thanks in advance.

0 Kudos
Message 1 of 4
(3,660 Views)
Solution
Accepted by topic author VI_Joe

Swap the order of the elements in your property nodes.  The property nodes execute from the top down, so you want to set the active plot first, then set its visibility.  As you have it now, the visibility of the plot is based on whatever was the last button you had pressed rather than the current one.

Message 2 of 4
(3,649 Views)

Can you save it under 8.5 version? I will like to see it too. Thanks!

0 Kudos
Message 3 of 4
(3,519 Views)

Ravens already gave you the solutions. Here are a few more comments:

 

You can leave the stop button latch action if you place the terminal in the upper loop. THe stop event does not need a terminal. This eliminates two local variables.


VI Joe wrote:

Ultimately, I would like to expand this featue to more than two plots with any number visible at once.


It always helps to make the code scaleable, so it is independent of the number of traces you ultimately have. In your program design, you need to clone the visibility events, one case for each trace with near duplicate code, and significant code changes are needed whenever you add or remove plots. 😮

If you make an array of booleans, all you need is one case and a small FOR loop and the code remains identical, no matter how many plots you add or remove in the future. 🙂

 

Atttached is a quick draft showing some of the ideas. (LabVIEW 8.0) See if it makes sense. 🙂

 

0 Kudos
Message 4 of 4
(3,500 Views)