LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically adding plots/views of data?

Solved!
Go to solution

I was recently playing around with DIAdem to view some data, and while it's not something I need every day it does do some things very nicely. For example, the data visualization stuff is VERY flexible. The data viewer lets you create tabbed "view windows" of your data similar to an Excel workbook. Once you have a "View", you can add a plot to it of several types- or a table of data. Here's the example it ships with- it's a view with a horizontal stack of two sub-views, a plot and a table:

 

BertMcMahan_0-1753311179178.png

You can then right click on one area to add more divisions- for example, right click the top window and select "New area- right" and you can add another plot:

 

BertMcMahan_1-1753311223750.png

 

Or you could make a polar plot, like this:

 

BertMcMahan_2-1753311261712.png

 

Or you could add another table. Or replace the table at the bottom with a Bode plot. Etc etc.

 

The point is, there are lots of options.

 

I'd like to have something like this in my built executables, as the code generates a lot of data and my various users plot it different ways. The idea is that they can generate a "view" of the data they like for the test they're running, and it will update whenever they take new data.

 

Is there anything like this for LabVIEW these days? DIAdem doesn't have a deploy license or a dumbed down "viewer" as far as I can tell. Generating the plots themselves is easy, but of course you can't dynamically add splitters and subpanels to make the cool "dynamic" layout stuff.

 

My only idea would be to make a handful of "subpanel templates"- say, one with two subpanels and a horizontal splitter (to make 3x stacked graphs), one with three subpanels and two splitters (for 4x stacked graphs), and the same for horizontal layouts.

 

By default, a single subpanel is loaded with a single plot. When the user splits the view, a 2x1 subpanel grid is inserted into the main subpanel, and the original graph is inserted into one of the two new panels. Now you have two smaller subpanels and a splitter. If they want to split one of those, move to a 3x1 subpanel grid.

 

This would nest easily enough and you could dynamically launch a bunch of subpanel grid holders. Nesting them would let you make some very dynamic info screens. Mixing up the horizontal and vertical dividers would let you make a wide variety of layouts possible.

 

Buuuutt.... that's a serious amount of work, and I'm sure it would be quite fiddly to debug. I was hoping there may already be a way to do this. Perhaps someone else already has a toolkit for it, or perhaps there's a .NET control or something I could use. Maybe the QT toolkit would implement something similar.

 

Any thoughts?

 

0 Kudos
Message 1 of 8
(341 Views)

I don't believe there are built-in tools to do this, but have a look at this Dynamic-Scaling library. It may be what you're looking for.

 

For the plots, I suggest Advanced Plotting Toolkit

Message 2 of 8
(289 Views)

@Basjong53 wrote:

I don't believe there are built-in tools to do this, but have a look at this Dynamic-Scaling library. It may be what you're looking for.

 

For the plots, I suggest Advanced Plotting Toolkit


IIRC, the online version needs some TLC.

 

There's a dynamic VI that should keep it's front panel in an executable. But I used to do this with an event structure in a disabled structure (doing nothing, except telling the builder to keep the FP). Between LV13 and LV20 this trick stopped doing the trick. The official method now is to put a FP reference on the BD. It doesn't need to be wired. 

0 Kudos
Message 3 of 8
(280 Views)

Thanks, I will look at the dynamic scaling library. I'd seen it before but hadn't investigated.

 

Also, it occurred to me you could do this simpler than I'd originally thought. You just need two VI's- a vertically divided one and a horizontally divided one. If you want three items in a row, just put a horizontally divided subpanel holder inside another horizontally divided subpanel holder. That gives you three of them.

 

The tricky part would be holding all of the references to each VI in a non-confusing way as well as scaling the three subpanels symmetrically. By default, you'd wind up with one subpanel that takes up half the screen and two that take up a quarter of the screen. Ideally you'd make them all equal width, making it look like you have three subpanels in a row. That shouldn't be too hard to figure out, but it'll take me some headscratching to figure out exactly how to do that. Probably some overall "manager" function to keep track of things.

0 Kudos
Message 4 of 8
(244 Views)
Solution
Accepted by BertMcMahan

I open-sourced a plotting library that does something similar to this.

It uses the oopanel library to handle all the subpanels.

The user has a plot-layout picker to switch between possible layouts.

 

https://www.vipm.io/package/brent_justice_lib_blueplotmulti_(open_source)/

Message 5 of 8
(223 Views)
Solution
Accepted by BertMcMahan

I was just about to say I do this with my OOPanel library, but it takes some work. It does make it easy to move panels around subpanels so they don't lose their state and you don't have to worry as much about what might already be in a subpanel as long as you keep track of all your panel classes. Layouts can be nested and there's a bunch of functionality around sizing, scrollable areas, etc. but using those extra capabilities takes a bit of work.

Some demos: https://www.youtube.com/live/vHBlU43eIow?si=1NqmklwTriVCv7IW&t=1431

 

I used this at an early employer to have hot swappable charts, control guis, and all sorts of fun stuff and generally do stuff where people that know LabVIEW ask "how in the hell?" 😄 It's got even more features now like linking scrolling between pairs of layouts but setting up something like what you're looking for wouldn't go beyond the simpler parts of the library.

~ Helping pave the path to long-term living and thriving in space. ~
Message 6 of 8
(217 Views)

Subpanels are you friends when making dynamic front panels. I have a similar program where I need to select different graphs based on the measurement type being done. I wrote a manger class to manage a predefine number of subpanels (only so many graphs can fit on your screen!) to populate, position and resize the subpanels.

There are no splitters, just subpanels and math 😉 It isn't too hard to write your own logic, but if more and more features are desired, indeed look into OOPanel library mentioned above.

0 Kudos
Message 7 of 8
(203 Views)

@brentjustice wrote:

I open-sourced a plotting library that does something similar to this.

It uses the oopanel library to handle all the subpanels.

The user has a plot-layout picker to switch between possible layouts.

 

https://www.vipm.io/package/brent_justice_lib_blueplotmulti_(open_source)/


This is pretty much exactly what I needed- thanks a ton! The preselected layouts is a great way to do this. Making a completely dynamic splitter arrangement like I mentioned wouldn't be nearly as user friendly as just picking from a list.

 

A couple questions/comments if you don't mind:

 

1- The .lvproj file has a missing dependency, but doesn't seem to affect the demo performance. I put an issue on Github with the info.

2- The description says this is "optimized for ring buffered data". It looks like it's main function is to display the last n minutes of data from a given ring buffer. Is that right? If so, do you foresee any issues plotting "regular" data? My use case takes a bunch of data all at once and never updates. Any tips on using the circular buffer data type with relative time data?

3- Is there, by any chance, a way to display the legend in another way? A very typical use case for my system is to display "Target" and "Actual" for a controlled signal (like a temperature ramp in a chamber). The legend as shown has FANTASTIC functionality but it looks like it's intended to be hidden during normal use, and I often need to display channel names "all the time". 

 

Thanks again for putting this out there. I'm extremely impressed with the popin/out legend editor. That's been an enormous thorn in my side for YEARS.

0 Kudos
Message 8 of 8
(183 Views)