Jump to content

Cons and pros of library structure


Recommended Posts

I have been using library structure to maintain all VIs. Lately I've been reading some comments why keeping them in directories instead would be even better.

I'd like to analyze the pros and cons of each approach but I truly know only the library structure.

And when I tried to list these, turns out I only have a vague feeling about some of my arguments.

Could someone be so kind and help me out by correcting and complementing my list.

And finally, which structure is better and why do you think so?

Library structure

Pros

  • Moving and copying the whole program is easy, just one file ... if you don't count any extra dll- and ini-files.
  • Unused files are automatically removed from library at save time.
  • Upgrading your software to newer LV versions is easy because libraries can hold all the device drivers as well

Cons

  • Returning the files to directories can't be done, or at least I don't know how.
  • Referencing a file inside the library might be possible, is it? I think not.
  • If naming is not done correctly, it can be a drag to find a certain file from large library.


Directory structure

Pros

  • Easy to group logical set of files to different directories
  • With dynamic calls, run time editing is possible

Cons

  • Upgrading LV version changes device drivers to new version also. They may but more probably may not work.

Link to comment

Hi Deep_Blue

Library structure Pros

  • Moving and copying the whole program is easy, just one file ... if you don't count any extra dll- and ini-files.
  • Unused files are automatically removed from library at save time. ??
    Do you mean when you recreate the llb in a new directory ? otherwize, as far as i know, unused file stay in llb.
  • Upgrading your software to newer LV versions is easy because libraries can hold all the device drivers as well.
  • LLBs can contain VIs from different version of labview (actually a pretty handy feature when one has to distribute an application with specific behavior in different LV version).

Library structure Cons

  • Returning the files to directories can't be done, or at least I don't know how.
    [This is actually wrong, go to tools>Vi labrary manager to do that.]
  • Referencing a file inside the library might be possible, is it? I think not.
    [Do you mean saving a file other that a VI type is not possible ? if so this is true. If you mean using VI server on a file in a llb, then this is possible.]
  • If naming is not done correctly, it can be a drag to find a certain file from large library.[true]
  • Since the llb is one file, you have no directory structure to organize your VIs (ex: Configuration, Custom Controls, Globals, Hardware Control ...)

Directory structure Pros

  • Easy to group logical set of files to different directories [yes].
  • With dynamic calls, run time editing is possible (so it is in llb?).

Directory structure Cons

  • Upgrading LV version changes device drivers to new version also. They may but more probably may not work. (again not so sure about what you mean here).

In my opinion, one should use directory structure when developping an application and use LLBs only when/if distributing the app.

PJM

Link to comment

Hi Deep_Blue

Library structure Pros

The distribution is easier with libraries.

It is also easier to keep track of which files are needed for a specific project.

It makes your computer less cluttered than seperate VI's.

Library structure Cons

Version tracking and source code control can be harder, because the source code control can't tell what files have changed. Almost all professional source code control software can't handle Labview easily, it has to store the enitre binary file each time it's saved, so your CVS system will fill up quick.

You can't add other type of files to the library, so if you have .dll's, .ini files, or even user documents, they are on their own.

If you have a sub-VI that is it's own file, and another VI with the same name in a Library you can't tell which one loads

Directory structure Pros

Like someone else said, you can sort your VI's by type (custom controls, analog in, etc.)

You can tell which files changed WITHOUT OPENING THEM simply by looking at dates in Windows explorer, which is usefull.

Directory structure Cons

It does take a lot of work/discipline to sort the vi's, because sometimes VI's don't fall into neatly defined categories.

I use mainly seperate VI's split into folders, and only use LLB's for distribution and source code control (I use a homemade LV based source code control).

Link to comment

Basically during development directories are a lot better. For distribution llbs may be handy.

Library structure

Pros

> * Unused files are automatically removed from library at save time.

This is not true. You have to load the top VI and selecte Save with Options to create a new directory structure or library which only contains the currently used VIs. This is the same for LLbs and directories.

> * Upgrading your software to newer LV versions is easy because libraries can hold all the device drivers as well

I think you talk about instrument drivers. Keeping them in a subdirectory to your project dir would achieve the same.

* Moderate compression of maybe 10 - 30 %. Nothing really to write home about.With harddisks costing dollars per GB and the fact that decompressing will also take performance everytime LabVIEW needs to load the VI into memory. For archiving purposes it is a good idea to ZIP up the entire source code tree anyhow.

Cons

> * Returning the files to directories can't be done, or at least I don't know how.

Wrong as pointed out.

> * Referencing a file inside the library might be possible, is it? I think not.

With VI server for sure. If you talk about accessing in in Explorer this is possible too. LabVIEW 7 and later has a feature in Options which installs a shell extension which allows you to browse LLB files (and see the VI icons of any LabVIEW file in the Explorer)

> * If naming is not done correctly, it can be a drag to find a certain file from large library.

Again with above shell extension (assuming you use Windows ;-) this problem is eased upon.

* Source code control won't work easily.

Directory structure

Pros

> * Easy to group logical set of files to different directories

Yes!

> * With dynamic calls, run time editing is possible

No difference to LLBs. You just have to consider that LLBs are handled by LabVIEW like an additional directory level with the LLB name as directory name.

* Source code control is much more effectively possible

Cons

> * Upgrading LV version changes device drivers to new version also. They may but more probably may not work.

No difference to when using LLBs. You will need to keep the instrument drivers together with your project for that to work, but that is also what is happening when they are copied inside the LLB. LabVIEW has also no preference to use VIs in an LLB instead of in a directory. It simply will try to load the VI from where it was last located when the calling VI was saved and if not found will start to search its standard paths indifferent if they are in LLBs or not.

Link to comment

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.

×
×
  • Create New...

Important Information

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