LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Large Application Structure

Hi all,

 

I am thinking about the structure of a large application.  I have built 5 independent VIs (each from independent LV Projects); 4 which gain the necessary inputs from the user (each has While Loop with Event Structure) and do their own processing to devise a large set of input data and parameters for a main processing VI.  The main processing VI can be slow to function.

 

I was considering the following structure:

 

A main UI VI which calls each of the 4 UI VIs in succession using an invoke node or similar via the VI subpanels.  I have never used a VI subpanel.

 

Passed to each of the 4 UI VIs is a large cluster which each contributes to.

 

The large cluster is passed to the main processing VI (which has independent While Loop) via a Queue?

 

Program Structure.jpg 

 

 Your thoughts, ideas and examples would be greatly appreciated.

 

Battler.

 

 

0 Kudos
Message 1 of 31
(4,331 Views)
You should research the subpanel structure (sounds very suitable in this kind of structure) and the use of Functional Globals (Labview wiki) or Action Engines  to store the large cluster and have it operate on the data.
Message Edited by andre.buurman@carya on 04-02-2010 01:20 PM
Message Edited by andre.buurman@carya on 04-02-2010 01:21 PM
Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 31
(4,296 Views)

Sounds reasonable. In the LabVIEW style book by Blume there is an example of using subpanels with vi server (if I remember correctly).

 

You could place the Config App, App1, ... inside a state machine. This will be nice if you need to change/insert anything on that sequence (lika an abort functionality).

If your processing App might be slow, it is also reasonable to use the producer/consumer design pattern.

 

I think some pitfalls are in the event handling of the main window. You would need one more loop to catch events like the Panel Close? or an global Exit. Then you need to pass this event to any of the 4 Apps that might be running in the SubPanel. I would advice to use User Events for this, as the apps already have an Event Structure.

 

If you go OOP, there is some more concepts you might use...

 

Felix

0 Kudos
Message 3 of 31
(4,282 Views)

Thanks guys.

 

I'm thinking SubPanels with Producer/Consumer structure.

 

I can't picture how a state machine might work.  Example?

 

Object orientated design I know nothing about..  How to learn more?

0 Kudos
Message 4 of 31
(4,279 Views)

You could have all VI's integrated in the main VI by putting it in a state-machine and have the UI's of the different VI be accesable via a tab control.

 

My personal favourite in this case is to use the subpanel when the configuration items have no direct relation and to use a single VI with tab control when they do.

 

Text below is just in case you don't know what a state-machine is.

 

State-machine basic explanation.

 

E.g. an application has 3 states:

 

Init (do all initialisation and auto-transition to next state "main"),

Main (do all normal application stuff, e.g. event structure for UI handling, transition to state "Clean-up" on app stop event),

Clean-up (close all references and delete temporary files). 

Message Edited by andre.buurman@carya on 04-02-2010 03:41 PM
Regards,
André (CLA, CLED)
0 Kudos
Message 5 of 31
(4,275 Views)

Yes I've used that structure (state-machine) before, but not for such a large application.  I think user events is more efficient than this, correct?

 

I'm thinking of adding Producer loop with processing VI.  Could I use a kind of global VI for this?  Can I acquire a queue from a VI not on the BD (i.e. globally) just by using the queue name?

 

Should I place the processing VI onto the BD?

 

How to pass 1 large cluster (is this the way to do it?) between applications which I'm calling via VI subpanel invoke method?  Since they will only be called and won't actually be placed onto BD (or will they?), how to pass data in and out of them?

Message Edited by battler. on 04-02-2010 08:46 AM
0 Kudos
Message 6 of 31
(4,267 Views)

"You could have all VI's integrated in the main VI by putting it in a state-machine and have the UI's of the different VI be accesable via a tab control."

 

Q.  How to make the UI of each VI accessible via Tab control?

 

My personal favourite in this case is to use the subpanel when the configuration items have no direct relation and to use a single VI with tab control when they do.

 

Q.  I have no idea what you mean.  Example?  Image?

0 Kudos
Message 7 of 31
(4,264 Views)

Q. What is you idea of a large application?

 

"Q.  How to make the UI of each VI accessible via Tab control?"

You will have to copy the frontpanel of the VI's to the pages of a tab control and integrate the code into the Vi that contains the tab control.

 

"Q.  I have no idea what you mean.  Example?  Image?'

E.g. there is settings VI for DAQ, one for logging and some more. In that case I would keep them in separate VI's and integrate them as either subpanels or as dialog boxes.

 

The Functional Global construct is very usefull to pass data between dynamically started VI's in case of the subpanel. It is advisable though to create one functional global per data type (e.g. one for DAQ parameters, one for Path configuration, etc)

Message Edited by andre.buurman@carya on 04-02-2010 04:16 PM
Regards,
André (CLA, CLED)
0 Kudos
Message 8 of 31
(4,252 Views)

To clarify some of my ideas, here a fast scetch:

 

Large App Scetch_BD.png

 

Sorry, CCT didn't work to make a snippet.

 

Felix

Message 9 of 31
(4,245 Views)

The application consists of 5 separate projects (100+ VIs each), each with a single main VI.

 

I am interested in the use of these "functional globals" but have never used them.  How can I learn more?

 

I also want to dynamically call VIs.  I believe I know how to do this but not sure how to best fit it into the overall structure.

 

Thanks for posting the screenshots.

0 Kudos
Message 10 of 31
(4,201 Views)