LabVIEW Development Best Practices Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Modular LabVIEW Application Development

cross-post with http://forums.lavag.org/Modular-LabVIEW-Application-Development-t13647.html

Dear All,

I am developing a medium-sized application. I've got a camera that detects a laser beam on a wall, a system that controls this beam and a switch to change between various beams. I used a modular architecture such that a separate program controls the camera (image acquisition and analysis), separate program to control the mentioned system, and a separate small program to control the switch. Each program can be run independently and can be build as a standalone application (used a consumer-producer architecture). Once I had those three small applications (let's call them sub-programs), I've written another application to control other apps. I implemented a common queue for all sub-programs and the main one to send 'telegrams' between all of them (cluster with two enums FROM,TO and two variants SUBJECT,MESSAGE). Each sub-program continuously checks the status of the 'telegram' queue and once the message is addressed to it, the queue element is dequeued and analyzed. The sub-program then does what it was asked to do and sends back an acknowledge telegram back to where it came from (the main application waits for this acknowledge). Then the main app access the data from the subprograms (functional global or reference to controls).. but it's a different story.

Basically it all works quite nicely, but it's not perfect, and I want to change it. I've got some ideas, but I was wondering if you have any suggestions, links to a good resources or ideas on how to develop such modular (is that a good word for it?) applications. Ideally with examples, and screenshots (or LabVIEW 7.1 compatible code).

BTW. I know about
http://zone.ni.com/devzone/cda/tut/p/id/7198 - Large Application Development in LabVIEW
http://zone.ni.com/wv/app/doc/p/id/wv-160 - Software Design Architectures in NI LabVIEW

http://zone.ni.com/devzone/cda/tut/p/id/3252 - Developing a Modular Software Architecture

but it's not really what I am looking for.


regards,
Jakub

0 Kudos
Message 1 of 5
(11,138 Views)

Jakub,

It's a tough question, since devising the appropriate architecture really depends upon being an expert on the application. A good place to start would be with the problems you have with your current architecture that you're hoping to address.  Your current architecture  sounds similar to the one explained on expressionflow - perhaps this article could lend some additional insights?

I'm curious to know why you're still developing in LabVIEW 7.1?  The latest versions of LabVIEW provide more sophisticated tools for architecture, such as the Statechart Module and LabVIEW classes.  Have you had the chance to use or try any of these?

Elijah Kerry
NI Director, Software Community
0 Kudos
Message 2 of 5
(4,084 Views)

Jakub,

Like Eli mentioned.  Looks like you have a great start.  So the question really is what do you need to do next.  How do you like your existing structure with the queues and the messaging.  That is very standard and can be very robust.  I am assuming that you are happy with this portion of the code.

So, do you want to scale the application?  Will you eventually need to add a new type of camera?  This is where some of the techniques that Eli mentioned can really come in handy.  Anytime I have a system where I know I want to have more than 1 of a kind then I immediately consider the native LabVIEW classes of 8.2 and greater (affectionally known as LVOOP, but sadly in need of a better, jazzier acronym ).  So if I will have multiple types of reports or multiple types of cameras I turn to LVOOP.  LVOOP is exceptionally powerful for scaling applications.  Let me know if this is what you have in mind and I'll point you to some examples.  And BTW, NI now has an OOP Course (shameful plug as I am one of the instructors) that covers a lot of ground on this topic in 2 days!

Let me know how I can help from here - cheers!

Nancy

0 Kudos
Message 3 of 5
(4,084 Views)

Hello Nancy,

I would love to be pointed to the LVOOP examples you spoke about.  I am looking at different architectures I can use for rewriting a large application that was originally written in LV4 and has grown out of necessity but without consideration for scalability, maintainability and certainly not readibility over the years.  I don't know anything about LVOOP but want to learn enough to make an informed decision.

Thanks,

Jon

0 Kudos
Message 4 of 5
(4,084 Views)

Hi Nancy,

Thanks for your suggestions. I will have a look at LV classes.As I mentioned I am still using LV 7.1.1 , but I do have access to 8.2 .We didn't upgrade our LV simply because there's never time to do it, and the upgrade itself may take quite a while due to number of applications we're using (we would obviously need to retest everything).   I also remeber a list of bugs that were found in higher version which made us to postpone our upgrade.Anyway. Back to modular architecture. I've got some feedback on LavaG forums: http://forums.lavag.org/Modular-LabVIEW-Application-Development-t13647.html please see this topis as well. My application seems to be very scalable, and in fact I had to add a new type of camera at some point (adding any type of device that uses different protocol and/or interface is tricky if you have wrong architecture), please see this topic to find out how I solved it in LV 7.1.1 : http://forums.lavag.org/How-to-cope-with-N-number-of-drivers-without-need-of-installing-them-t13451.html

cheers,

Jakub

0 Kudos
Message 5 of 5
(4,084 Views)