LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control the order of plots

Solved!
Go to solution

Cameron,

Now I have run your VI. It is ingenious and I wouldn't have thought of it.  However, it does not do what I was seeking, because it DOES change the order of array elements going in to the plot.  In your VI, the white "plot 0" is always in front. It is easier to see this if you make the lines really thick. But the data being plotted as "plot 0" keeps changing in your VI.  If the labels really meant something (such as position, velocity, acceleration) then I'd also have to change the plot labels each time I change the plot order, with your VI, to keep the labels correct.  That could be done with property nodes, but it would get complicated.

Thanks for your help.

Bill

0 Kudos
Message 11 of 19
(1,107 Views)

Oh, but you haven't run my optimized VI, which is in my last post. It does, I think, what you want, with the possible exception of keeping the top right legends in a consistent order (they are right, however). The property node thing for swapping colors around is no big deal - you just have to wire it exactly backwards of the plot ordering wires. It's all there.

 

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>
Message 12 of 19
(1,105 Views)

Cameron: I am impressed.  Your new and improved VI keeps the labels and colors associated with each data set, as the order is altered. It would be nice if one could just click on a trace and select "Move forward" or "Move backward".  But we can't, and you have provided an alternative method. Thank you.

0 Kudos
Message 13 of 19
(1,098 Views)

Oh, you could, but I didn't.That's the situation which an author would "leave as an exercise to the reader". A drag-and-drop control might also be fun to use there, but I don't have any experience with those (check back in a month or so, that's the next thing I have to implement in my UI's).

 

You know, probably a better way than using an enum on that would be to use a ring control, because you can get a drop-down listing of all the possibilities (at least the ones you included in the ring) to choose from, instead of having to cycle through them one at a time.

 

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>
Message 14 of 19
(1,088 Views)

Hi Cameron,

 

you don't have to "cycle through" an enum, you can also select from a list of entries here.

Using drag&drop is very easy with a listbox, it has that feature built-in - just check the settings with a right-click...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 15 of 19
(1,084 Views)

Thanks, Gerd, it'll be nice if something in LV is easy right-out-of-the-box (and I'm not including Express VI's in that category) for a self-taught programmer (although I did take Core1 and 2 when I had the chance - they were invaluable).

 

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 16 of 19
(1,082 Views)

Your last example does work a whole lot better.

 

It still proves that Jeff was right, and that you can't do this without changing the order of the plots in the legend, which is was what the OP did not want to do.

 

But your idea of creating a static legend would be one way of making it appear that the order as not been changed.  It's not ideal.  And you lose the ability to do some things that are built into LabVIEW such as change plot visibility unless you want to do a whole lot more programming.

Message 17 of 19
(1,074 Views)

Those are good points, RavensFan.

0 Kudos
Message 18 of 19
(1,070 Views)

Thanks, RF.

 

But, as far as my "static legend" workaround being "not ideal," Sure, I know it isn't, but I don't think I've ever done an "ideal" thing in my life. It's just a workaround to present an example of what you could do if that's the kind of thing Bill was looking for. I just look at the legend as a quick way to identify the specific plots, and that, to me, would be the quickest to follow.

 

Besides, I'm still on a pretty steep part of the LV learning curve, a lot more climbing to go.

 

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>
Message 19 of 19
(1,063 Views)