Jump to content

Can I trim the size of a dynamically loaded VI?


kawait

Recommended Posts

Hi all LabVIEW developers,

I am developing a program that controls a network analyzer. The VIs that actually does instrument communication (i.e. calling VISA functions) are reside in a llb file, and each VI only perform a particular function (eg. reading the center frequency of a sweep). They are dynamically loaded by a toplevel VI as needed. By writing the program this way, I can add new functions later by just including the VIs performing the functions in the llb file.

As I am working on it I found that this approach has a big problem: the size of those "instrument contol" VIs (in a llb file) could one day have grown very large. Now in the llb file I have getter/setter pair of 7 parameters (14 VIs in total) and the file size of the llb file is closed to 400kB. And I think I will add more and more complicated features so I am afraid that it would grow very large.

As we know, much of the space of a VI is for the representation of front panel and block diagram. If I use the VIs just for distrubution and their panel are not shown, I think it is not necessary to keep that information in the VIs. It is possible to save the VIs in a more compact form (eg. just the code, not the graphical stuff).

Since I am a LabVIEW novice (I started LabVIEW programming 3 months ago). I would also appreciate your comment about my approach. I would be glad to hear suggestions about how to make it better.

Regards,

Kawait.

Link to comment
Hi all LabVIEW developers,

As I am working on it I found that this approach has a big problem: the size of those "instrument contol" VIs (in a llb file) could one day have grown very large. Now in the llb file I have getter/setter pair of 7 parameters (14 VIs in total) and the file size of the llb file is closed to 400kB. And I think I will add more and more complicated features so I am afraid that it would grow very large.

If you are indeed worrying about the file size getting too big, I'm not sure the worry is justified in this era of huge disk drives and disappearing interest in floppy disks.

It is possible to save the VIs in a more compact form (eg. just the code, not the graphical stuff).

Yes, using the file zip tools of the OpenG package, you could decompress zipped VIs before they were called and delete the expanded file afterwards.

If you have the application builder as part of your LabVIEW development system you could use it to strip the front panels from the VIs that didn't require them before they are saved to the LLB file.

You can also minimize the amount of memory used by the front panels that are required by minimizing the number and complexity of the controls & indicators you use on the front panels.

Link to comment

Kawait,

This is not a direct answer to your question, but is there any particular reason you are using LLBs? Other than for grouping your VIs?

LLBs are not recommended for development these days. You will want to go through the following two threads for further details:

http://forums.lavausergroup.org/index.php?showtopic=355

http://forums.lavausergroup.org/index.php?showtopic=2118

Regards,

-Khalid

Link to comment

Thanks for your reply!

If you are indeed worrying about the file size getting too big, I'm not sure the worry is justified in this era of huge disk drives and disappearing interest in floppy disks.

Yes, the disk space is not an issue at all nowadays. But I just want to know if I can strip off the part that is not needed, since the front panel does nothing other than passing variable in and out.

Kawait,

This is not a direct answer to your question, but is there any particular reason you are using LLBs? Other than for grouping your VIs?

LLBs are not recommended for development these days. You will want to go through the following two threads for further details:

http://forums.lavausergroup.org/index.php?showtopic=355

http://forums.lavausergroup.org/index.php?showtopic=2118

Regards,

-Khalid

Thanks for your info. Indeed, I didnt have any particular reason of usign LLBs. I used it just because I saw it is used extensively in LabVIEW library functions.

Link to comment
Thanks for your reply!

Yes, the disk space is not an issue at all nowadays. But I just want to know if I can strip off the part that is not needed, since the front panel does nothing other than passing variable in and out.

Thanks for your info. Indeed, I didnt have any particular reason of usign LLBs. I used it just because I saw it is used extensively in LabVIEW library functions.

You can strip the front panel, but for the VIs you want to call dynamically you shouldn't do that. In order for the dynamic parameter passing to work the VI really should have it's front panel otherwise you will get all sorts of errors when trying to load such a VI dynamically and/or call it.

Rolf Kalbermatter

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.