Jump to content

Exchange lvlib with another lvlib


Recommended Posts

Hi

I am looking for an efficient way to replace the VIs of a lvlib with another lvlib with the same type of VIs in multiple projects. It should be done without having to do the replace for each single VI, because there are up to 50 public VIs in the lvlib.

As an example:

A lvlib with these VIs:

LibA.lvlib:FuncA.vi
LibA.lvlib:FuncB.vi
LibA.lvlib:FuncC.vi

Is to be repleced in all the code with another lvlib with these VIs:

LibB.lvlib:FuncA.vi
LibB.lvlib:FuncB.vi
LibB.lvlib:FuncC.vi

Of course the VIs have the same interfaces.

In a text based language, this would be quite simple. How can this be done in LabVIEW

Thanks

 

Link to comment

Unfortunately, there is no straightforward way to do this in LabVIEW.

I can think of one trick which takes advantage of the LabVIEW Project Explorer: When a library gets renamed or moved, the Project Explorer automatically updates the links in all of the project's VIs. So,

  1. Close LabVIEW.
  2. Temporarily delete or move LibB away to a completely different folder where it  can't be found by LabVIEW.
  3. Open your project's .lvproj file.
  4. Use the LabVIEW Project Explorer to rename LibA.lvlib to LibB.lvlib, saving it in the folder where the real LibB used to be. This will update all your project VIs' links.
  5. Click "Save All" on your project to make the update permanent.
  6. Close your project.
  7. Delete the fake LibB and all the old LibA VIs. Restore the real LibB.
  8. Open your project. It should now pick up LibB instead of LibA. (It might complain that the LibB VIs were not in the expected folder. If it does, just "Save All" again and it will be happy after that)

Make sure you back up everything before attempting this; rinse and repeat will all your projects.

Caveat: If your project uses LibA in more than 1 Application Instance, LabVIEW will lock the library when you open your project, which blocks you from doing step #4.

Link to comment
8 hours ago, D. Ackermann said:

I never looked into VI scripting. Maybe this could be a way to replace all lvlib VIs in a complete project?

Yes, that can do the job. It will take some time to write the script, however. (I'd set aside a few days if you've never done VI scripting before)

Could you simply modify LibA instead of replacing it with a different library with the same interface?

Link to comment

I will take a look at VI Scripting then.

The situation is like this:
LibA is out there for years. Now a 2.0 version of LibA called LibB will be created. LibB is doing things quite different internally and depending on other software. Therefore the transition from LibA to LibB requires multiple changes on the systems it is deployed to. A developer with multiple deployed systems will have a transition period where he has to work with LibA and LibB. That is why I don't want to make it LibA 2.0. That would require installing the LibA versions back and forth. With creating LibB they can be installed parallel. Now I am trying to find the best way to upgrade projects from LibA to LibB..

 

 

 

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.