Jump to content

Distributing an application built with plugin architechture


Recommended Posts

Hi all,

My question deals with how best to distribute large collections of lvclasses that implement a 'plugin' architecture. Some background first:

I've been reading the lava forum for about two years and dove head first into LVOOP about a year and a half ago. As such I may be calling what I have 'plugin' when a better term already exisits for what I'm doing; please correct me if there is a better term.

The application I've got implements essentially a dynamic form that allows the user to structure properties of a tdms file with information needed to complete some kind of test on one of our products. This 'blank' file is distributed to the correct test stand where it can be used to spawn data files that are populated with information from each test run. Pretty common task I think.

To implement this I have a four-tiered class hierarchy:

Generic Metadata -> Generic Product Series -> Specific Series -> Specific Model

The bulk of the code and all the interfaces are implemented in the first two classes with the last two providing overriding methods as needed for whatever specific product is being worked with (which is why I'm calling it a plugin architecture). This means the last two classes represent an ontology of the company's product line, which means there are a LOT of classes there. Last count I had 24 Specific Series and around 1000 Specific Models.

In the development environment, I load the first two classes as constants on the block diagram then use a factory to load the specific classes from disk at run time by building a relative path off of the top level class path. This works well because all the classes are part of my project and are therefore easy to manage on disk, but I need to be able to build this application into an executable and distribute it to the entire company.

How can I include the classes in my distribution and load them at run time without making maintenance a nightmare?

Would packing each class and its methods into an llb, including all the llbs in an installer, and loading each class from the llb at run time work? Would my dynamic VIs work from inside llbs? Would packed project libraries be a better choice? Do I have to put the entire class hierarchy inside the library or can I compile the top two classes into the exe?

Lots of questions! :)

Also I tried to upload a diagram of my class hierarchy, but I think my webfilter is preventing me from uploading anything.

Link to post
Share on other sites

Tim,

I actually just found that document, thanks.

The models don't change in terms of the hierarchy, but the information I need to know about them is...unknown. As we test and develop we're finding more critical peices of information that are model- or series-specific. For instance (most of our products are pumps, btw), one series has a clearance dimension between the impeller and case that is critical to performance, but this clearance isn't even a feature of most of our designs. In order to make the data useful, I have to track that clearance for each test done on that series of products. Because of this I will need to be able to reliably and easily adjust the way my application responds to different series and models, which sounded like plugins to me.

Link to post
Share on other sites

Tim,

I actually just found that document, thanks.

The models don't change in terms of the hierarchy, but the information I need to know about them is...unknown. As we test and develop we're finding more critical peices of information that are model- or series-specific. For instance (most of our products are pumps, btw), one series has a clearance dimension between the impeller and case that is critical to performance, but this clearance isn't even a feature of most of our designs. In order to make the data useful, I have to track that clearance for each test done on that series of products. Because of this I will need to be able to reliably and easily adjust the way my application responds to different series and models, which sounded like plugins to me.

Hmm. So are you saying it is data tracking rather than interfacing (like different comms interfaces, different functions etc)? Maybe a DB would be a better way forward and could simplify your heirarchy to series 1,2,3 etc.

  • Like 1
Link to post
Share on other sites

The easiest way is probably to deploy your Series and Model classes as a source distribution to a predefined directory and have the application look for them there. If you're uncomfortable with having the source code directly visible on disk, I know others who have successfully deployed plugins as llbs, though I have no experience with that. Personally I think packed project libraries sound like more trouble than they're worth for deploying plugins.

Depending on your situation, Shawn's suggestion may be a better approach and save you lots of time in the long run. Maybe the database contains a list of all the critical parameters for each product and the UI presents the list to the operator, giving them an opportunity to fill in the data. That way you don't have to keep going back to edit the source code--you can just update the database.

Link to post
Share on other sites

Yes it may be possible to eliminate the model classes and replace them with a database. There's actually a simple database below the model classes already that provides information on model permutations (there is an average of 5 permutations for each of the 1000 models). If it turns out that I would never need to implement a model-specific interface then I could roll those classes into the DB and make distribution of the series plugins much more manageable.

I know I'll need to keep the series at least implemented as classes because I have to interface to different setup tools and inspection reports based on the series. So then my challenge becomes figuring out how to be certain that I won't need to build interfaces that are model-specific.

Link to post
Share on other sites

Well thanks Tim, Shawn, and Daklu! I rolled the model classes into a database and achieved the same functionality in a couple hours. That'll make the whole thing, well, 1000 times easier to distribute!

I think I am going to try to implement the remaining ~24 classes as packed project libraries though.

Thanks again!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By Ryan Vallieu
      I have seemingly found an issue with the shipping example code for Nested Malleable VIs.  Another user has verified that he saw the same behavior in 2019.
       
      I am working through the examples and the presentation from NIWeek 2019.  In running the Lesson 2b code (C:\Program Files (x86)\National Instruments\LabVIEW 2019\examples\Malleable VIs\Nested Malleable VIs) I found the Equals.vi in the class was not being leveraged and the search failed.  When I went to my LabVIEW 2018 machine and ran the Lesson 2b.vi the code worked to find the element by correctly leveraging the in-class Equals.vi.
      One difference I see is that in the 2018 example the Equal.vi is in the example folder with the code, and in 2019 the Equal.vi has been moved to VI.lib - otherwise the code looks to be the same.  The Equals.vi code looks identical, and the calling VIM look identical.  I posted on the LabVIEW NI.com forum here: 
      https://forums.ni.com/t5/LabVIEW/LabVIEW-2019-Malleable-VIs-Shipping-Examples-Lesson-2b-Nested/m-p/3966044/highlight/false#M1129678
       
      I am trying to determine what may have broken or changed between the implementation in 2018 and 2019, visually the code looks the same.
    • By Gan Uesli Starling
      We have a gage supplied by a company that shipped it with a *.exe application targeted for LVRTE 2009. I need to retarget it for 2017, but don't have the source code. The supplier had said they'd gladly supply me with a copy of the *.LV source, but they have looked and cannot find their own copy in-house.
      History of Need: Our global corporate mother ship's IT department, in their infinite wisdom, is mandating an upgrade from Win7 to Win10. That with yet even further constraints. They enforce a list of "approved versions" of "approved applications". And for LVRTE, they are insisting upon 2017, with 2009 being a red light.
      So, then, my query. Is converting an app without the source for a higher LVRTE doable at all? File is attached.
      If it is doable, instructions on how?
      Concentricity-Gage.exe
    • By Dawid
      I'm trying to execute LPR.exe command to print some labels on a printer. However as its normal, problems occur. I could not find answer on any topic conneced with "sytem exec". I already tried all described methods (I think so). That's why I'm asking very kindly for any help.
      When trying to execute or call the LPR.exe from System exec VI, I'm receiving error:
      "'C:\Windows\System32\lpr.exe' is not recognized as an internal or external command, operable program or batch file."
      Generally I would like to call function: "lpr -S 192.168.1.5 -P lp C:\test\do_druku.txt" which works from command window without any problem.
       

      print.vi

    • By Voklaif
      Hello all,
      I am programming with LabVIEW for around 2 years and was recently stumbled upon LVOOP.
      I am required to write a communication protocol to work with a micro-controller, which later will be also used for ATP and debug purposes.
      I want to build the program "correctly" from the beginning so it will be maintainable and flexible to additions and changes.
      My natural way of building a program would have been a queued state machine, with several loops, each loop is in charge of a different module (one for GUI obviously), but as I stated in the beginning, I want to use LVOOP.
      Does anyone have a LVOOP project I can use as reference? I've searched online and found some nice examples, but they are small and teach you the basic stuff.
      For me it's important to see the how to use the project tree wisely, where to place the classes, see the managing loop and to learn as much as possible before I create one of my own.
      Thanks in advance,
      Voklaif
    • By GregFreeman
      I have an array of classes, let's call the object TestPass, of size 1 (but it is an array because it can scale out to multiple test passes). In this class, there is one other nested class which is not too complex, then various numeric and string fields to hold some private data. There is also an array of clusters. In this cluster there is a string, two XY pair clusters, and an integer. Not very confusing.
      This array of clusters gets fairly large, however, upwards of 80-100k elements. What I am finding is when I index the array of pass classes it is crazy slow. On the order of 30 ms. Doesn't seem like much, but we are indexing the array in our method to "Get Current Pass" which is used in various places throughout our code. This is adding potentially hours to our test time over the 80k devices we are testing. 
      So, I started digging. When I flatten the class to a string and get the length, it's 3 mb. But, when I run the function with the profiler is is allocating close to 20 mb of memory!
      My gut feel was that the string is causing the issues. So I removed the string from the cluster and the index time went to 0 ms. 
      Luckily we can normalize a bit and pull the strings out of the cluster since a lot of them are duplicates. But it makes our data model a bit uglier. 
      Has anyone seen these kind of performance issues before? I saw them in 2013 and 2017.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.