LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow loading of packed library

Hi,

 

I'm building an application whose purpose is to do a full automatic test of an electronic component.

 

I have 41 tests to run and i have built a separate vi for each of them.

 

My main vi calls each of the 41 vi sequentially (with the "open reference" function) and puts the front panel of the test in progress in a subpanel. The main vi is also in charge of doing some data acquisition and launching 3 clones of the same vi - whose purpose is to simulate a specific device - running in parallel (simulated device clone 1, 2, 3).

 

The main vi push analog data to the simulated devices through named queues. If the simulated device hasn't received a new piece of analog data for more than 2s, it goes to error mode (time out).

 

Because I dont want the final user of the program to have access to the code, i have tried to put all the vi of the 41 tests in one big packed library.

 

My issue is that the calling of the tests located inside the packed library is very slow and basically hangs my main vi for more than two seconds! Hence, the 3 simulations of the device time out and go to error mode! I can't increase the time out of the simulated device device because it must react with a certain speed to some input (no detail given...)

 

 

 

So my question is how, could I speed up the loading of the vi located inside a packed library and most of all, how could I avoid the loading to hang my main vi?

 

Alternatively, i can use a different approach than the packed library... is there any other way i could protect the code of my vi from being stealed by the final user? I was thinking maybe LLB with a password... any experience with that?

 

Thanks,

 

Peper

 

 

 

0 Kudos
Message 1 of 24
(3,794 Views)

Is anybody using packed library?

0 Kudos
Message 2 of 24
(3,761 Views)

Can you share code concerning this issue?

This way I can try to reproduce it at my side.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 3 of 24
(3,754 Views)

Can you pre-load the subVIs?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 24
(3,734 Views)

Pepper,  you can do a source distribution and add a password for every VI.  You can also completely remove the block diagram (side effect is that the code cannot be recompiled for a different version of LabVIEW).  You can then call each VI directly without a long loading time.

 

In your project, select "Source Distribution" in "Build Specifications" and look for "Source File Settings"

 

See LabVIEW help for more information.

0 Kudos
Message 5 of 24
(3,731 Views)

Hi,

 

Thanks all for replying.

 

To Thierry==> Unfortunately, i can't share the code because it's a sensitive project for a military application.

 

To Bill ==> Preloading could be an option. Can you tell me how to pre-load a packed library? I thought that opening and closing a reference  to all the vi inside the library (some kind of initialization) would make the second opening faster but it's not...

 

To OlivierL ==> I will try your solution  but i'd rather have a single file to load and not multiple files in a directory (hence my idea to use a packed library). So i'll also to try to make a LLB with a password and remove the block diagram of all the vi inside the LLB.

 

Regards,

 

Peper

 

0 Kudos
Message 6 of 24
(3,714 Views)

Hello Peper,

 

Is it possible to make a simplification of the issue that you can share?

 

This way I can check what is going wrong and help you to resolve the issue.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 7 of 24
(3,709 Views)

Hi everyone,

 

 

OlivierL=>  I tried the solution of the source distribution with removed block diagrams and I chose to make a LLB so I could distribute only one file.

 

The solution works and, indeed the loading of all the small test vi's is way faster!

 

The only side effect is that, all the dependencies of the test vi's are obviously also duplicated in the LLB, causing quite a few conflict issues in my projet.

 

I have 3 differents batch of test (device test, self test, power test), all using the same subvis,and I want to make one LLB per batch of tests. That would mean a lot of conflicts in my project!;)

 

 

 

Bill=>  From what I've read here, my problem is that each time I call a vi from the packed library, all the vi's of this packed library are loaded in memory (that means 41 public vi's plus a lot of private subvi's). I think that's why the loading is so slow!

 

I've guessed that the corollary is that when a vi of the packed lib is closed, all the vi's are unloaded from memory. 

 

Originally I closed the reference of the vi after each call, which unloaded the whole packed lib. In consequence, each time a called a new vi from the packedlib,  the whole packed lib was reloaded causing labview to hang for a few seconds.

 

So, I have disabled the closing of the reference at the end of the call and now, only the first call triggers the loading of the library!:

 

Close reference disabled.png

 

But,...

 

Do you know if there is any side-effects to not closing the reference of the vi?

 

Also, when I load the first vi of the packed library, a loading screen appears (when labview tries to locate all the needed subvi's) is there a way to disable this screen? I don't want the user to see that loading screen.

 

Best regards,

 

peper

 

0 Kudos
Message 8 of 24
(3,689 Views)

@peper2001 wrote:

Hi everyone,

 

 

OlivierL=>  I tried the solution of the source distribution with removed block diagrams and I chose to make a LLB so I could distribute only one file.

 

The solution works and, indeed the loading of all the small test vi's is way faster!

 

The only side effect is that, all the dependencies of the test vi's are obviously also duplicated in the LLB, causing quite a few conflict issues in my projet.

 

I have 3 differents batch of test (device test, self test, power test), all using the same subvis,and I want to make one LLB per batch of tests. That would mean a lot of conflicts in my project!;)

 

 

 

Bill=>  From what I've read here, my problem is that each time I call a vi from the packed library, all the vi's of this packed library are loaded in memory (that means 41 public vi's plus a lot of private subvi's). I think that's why the loading is so slow!

 

I've guessed that the corollary is that when a vi of the packed lib is closed, all the vi's are unloaded from memory. 

 

Originally I closed the reference of the vi after each call, which unloaded the whole packed lib. In consequence, each time a called a new vi from the packedlib,  the whole packed lib was reloaded causing labview to hang for a few seconds.

 

So, I have disabled the closing of the reference at the end of the call and now, only the first call triggers the loading of the library!:

 

Close reference disabled.png

 

But,...

 

Do you know if there is any side-effects to not closing the reference of the vi?

 

Also, when I load the first vi of the packed library, a loading screen appears (when labview tries to locate all the needed subvi's) is there a way to disable this screen? I don't want the user to see that loading screen.

 

Best regards,

 

peper

 


The only side-effect that I can think of is that you'll have to remember to close it in a different spot in your code.  😉

 

I thought I saw something like "disable VI loading screen blahblahblah" somewhere, but I can't remember where.  Maybe it was just wishful thinking.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 24
(3,682 Views)

Look at this post:

 

http://forums.ni.com/t5/LabVIEW/Suppress-VI-search-dialog/m-p/1029291/highlight/true#M458437

 

Message #9.

 

I have not tested but I remember reading this before!

 

-----------------

Olivier

0 Kudos
Message 10 of 24
(3,673 Views)