LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass data to a 'popup' subVI from a main VI in a decent way

Continuing on another thread at this forum (http://forums.ni.com/ni/board/message?board.id=170&message.id=132285), I'm trying to build a GUI to display data. Because I'm relatively new to LabVIEW and especially to it's GUI and calling of multiple VI's, I'm strugling with it and I feel like getting buried under all the information.

I Think my program should be very easy to program, but I'm just to unexperienced with it to know where and how to start on some things. Let me explain what the program should display and how.

Data acquired from a few serial ports/DAQ needs to be displayed on about 9 'instruments' on the monitor. Acquiring data and sampling it is no problem for me, I created a bunch of VI's for it (and bundling data and so on to a connector). But then I want it displayed on the monitor, no big deal if it would only need to be displayed on the same way, here is where my troubling starts.

Let's divide the screen in 3*3 parts, in case of a 960*720 resolution you then end up with 9 windows of 320*240 in size, this is my starting point from where all the VI's are designed. I've included a sample of 1 'instrument'-display. This is a 320*240 sized thing, which scales itself depending on the actual panel size, so that it can be used for every 4*3 resolution beginning at 960*720. Now picture 8 more of these VI's on 1 'frontpanel'. At all time they need to be updated with the current values (which are coming from different VI's), looks to me I need 9 VI's running 'on top' of my standard executable panel if you get what I mean.

Now comes the tricky bit (at least for me), for 1 of these windows, I think of the logo of the yacht and when the logo is clicked for 1 second all the 9 panels turn into night-mode (you can see it in the demo, when connecting a control to it), this is only a variable who's value needs to be changed. Because most of the 9 panels do not display all the information or do not have all the controls which are needed (some debug info containing all the data gathered need to be displayed and in case of my example the units (m/s and knots) needs to be changed, or i.e. the scale of a waveform chart for other 'panels') are not displayed on the standard display. But when somewhere in a panel a mouse down occures then a 'property or config' display needs to be opened corresponding with the 320*240 area clicked where this info is displayed and some controls are placed. During this period, the remaining 8 panels need to be still updated with data, after changing (or just reading) data the user should be able to choose OK or Cancel or press outside the panel which would cancel the values too. Anyway when confirmed or not confirmed the display should return to it's standard "monitor" function in day or night view. At any time a maximum of 1 instrument should display it's 'sub-display'.

I Hope it is somewhat clear on how it should work ultimately, despite my poor way of explanation in English. When I get some examples of the best way to do something like this I should be able to fix it, by means of that at this point I don't even get if and how I should use global variables or funtional globals, call by reference and so on...
0 Kudos
Message 1 of 27
(4,375 Views)
0 Kudos
Message 2 of 27
(4,355 Views)
I'm not sure I understand the second part of your request, but here is a quick example of how the first part can work with subpanels and globals, saving you the headache of having multiple windows. You can use property nodes with the VI references to change things inside the VIs. I believe you can also use event structures inside the subVIs.

___________________
Try to take over the world!
0 Kudos
Message 3 of 27
(4,347 Views)
OK, I will try again.

Message Edited by tst on 08-08-2005 05:58 PM


___________________
Try to take over the world!
0 Kudos
Message 4 of 27
(4,326 Views)
Sorry, I tend to get too confusing sometimes. Maybe I can illustrate something

1|2|3
------
4|5|6
------
7|8|9

1 to 9 are the 320*240 panels

In a normal situation they all display the data (normal indicators and so on)
When one of them is pressed another VI pops up displaying the debug info or settings (positioned exactly over the corresponding VI), and only one active at a time.

All 9 panels are in night or daymode, and should be updated synchronously, independent of an opened debug or setting VI.


0 Kudos
Message 5 of 27
(4,324 Views)
Think I get how to fix the 9 different VI's and the globals, but what about the second display what I name the 'settings' of the VI, I tried something but it doesn't work like intended. Looks to me somehow the standard panel needs to be closed and the settings panel opened (this must happen whenever clicked in the standard panel). The settings panel would open in the container and display an OK and Cancel button, respectively accepting or discharging the values, and return to the standard display when one of the 2 buttons pressed or when clicked outside this panel container.
0 Kudos
Message 6 of 27
(4,302 Views)

The settings VI doesn't need to be a VIT, since you will only have it open once each time. You can have it as a regular subVI. You can set its window appearance to Modal and that will force the user to close it before continuing. Have the event stucture open it without affecting the rest of the code in the display VI. If you want to be sure the loop with the event structure stops have a timeout event which will check the global stop.

Also, using all those subpanels made the code in the top VI messy and strict. Try cleaning it up (maybe by placing the running in the loop and setting Waiting Until Done to F or by placing the code in a reentrant subVI).


___________________
Try to take over the world!
0 Kudos
Message 7 of 27
(4,295 Views)
Ok, using the Panel Container I managed to get something more or less functioning the way I want. The first VI displayed should be the normal 'indicator', when mouse down > 2 sec the setting/properties will open, then the user must press OK to continue (variables should be updated at that point, Cancel needs to be added to discard), and the original loads. I'm not sure if all this costs a lot of memory or that LabVIEW opens up new instances of the VI's every time so a memory overflow will possibly occur?

Does this clear the second part of my first question up?
0 Kudos
Message 8 of 27
(4,279 Views)

First, no memory overflow will occur with such small demands. For LV to experience memory problems you will need to do much more intensive things and as long as you close everything you open, you will be fine.

Second, I'm still not entirely sure what you're trying to do here, but if possible, I would say go for a single subVI and hide\unhide whatever controls are needed. Then, make that VI modal and the user will be forced to finish using it before continuing.


___________________
Try to take over the world!
0 Kudos
Message 9 of 27
(4,265 Views)
Been busy with the 'main panel', looks like I now get a close match to the demands. Made a library of it, is this handy when building an application with the application builder or should I go for another approach, I don't get a working program while using the LLB file (opening main_panel.vi) and let LV build an application (missing VI's), sounds logically, do I need to include every single VI into the builder seperately?
0 Kudos
Message 10 of 27
(4,247 Views)