From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

classes in lvlib

I had a huge meltdown about 15 minutes ago and i'm not sure what to do but this seemed like really erratic behavior.

 

I had a whole bunch of classes in an lvlib in order to preserve all my inheritances (since i couldnt figure out how to do inheritance without some form of project).  Anyways, so i had an older project that used the lvlib and was listed in the dependencies in the project window.  Now when the project had last been accessed the lvlib didnt have near the number of classes now and it remembered the classes that were in it before but not the new ones, or even new methods in the classes that were already in existence.  Well i wanted to use some new methods from the older classes so i needed to make them appear somehow.  dragging the lvlib from the dependecies to the project list didnt force the project window to refresh it.  I wasn't sure what would happen if i dragged a class out of the lvlib so i didnt do that.  instead i dragged it back to the dependencies and then added the lvlib manually through right clicking and choosing add file.  in any case it loaded the whole thing but it also brought some unwanted conflicts. So i started playing with it and i couldn't figure out how to get all these conflicts resolved.  I unloaded one, loaded the other, all of a sudden windows were flying up and down and i couldn't keep up with what was all going on.  Finally i gave up trying to get it to work and just said i'm going to load my lvlib and close everything else.  When i went to load my lvlib it was empty.  This is not good as i figured i would now have to manually add all my classes back in which would take some time.  What i didnt realize that loading all the classses back into the lvlib creates a ton of errors, some which labview can't even tell me what the error is.  I'm curious to know if anyoen else has run into this kind of trouble.  I know when i come into work tomorrow im going to have to spend a long time rewriting all these classes if i cant figure out an easy way to recover what i had before.  If anyone else ran into this please help, as i dont want to waste all this time writing what ive already written!

 

regards

 

Brent Schenk 

0 Kudos
Message 1 of 3
(2,743 Views)

Brent,

 

The classes you created are stored on disk as .lvclass files, so you should be able to just add those to your new or existing projects without having to rewrite them. 

I do not quite understand what you mean by "...it remembered the classes that were in it before but not the new ones, or even new methods in the classes that were already in existence." Did you save your classes and libraries but it didn't save correctly? 

It sounds like your problems are coming from resource conflicts between multiple projects you're using. I was able to reproduce the resource conflict errors when manually adding classes/libraries, but only when another project was open at the same time with the same dependencies.

The bottom line is, make sure you save any new components to the project you create so that you can find them on disk later and are able to reuse them. 

Misha
Message 2 of 3
(2,717 Views)

Hey misha

 

thanks for taking the time to try to reproduce the error and reply!

 

I found out that there was an old version of this lvlib that i had thought i had deleted that the project had loaded.  So when i loaded the new version of it you can imagine that just about everything in that old one that matched the new one created conflicts.  I'm not sure what exactly went wrong but it ended up emtying out my new lvlib of all of its classes.  after closing labview all the way and reloading things i was able to add most of the classes but with some minor errors that i had to clean up.  The weirdest thing was one of my classes kept telling me that i didnt have permission to overwrite any of its files and save the change when i added it to the lvlib to make sure it knew it was associated with it.  I ended up rewriting that one clas, or really copying the block diagrams and then resaving it somewhere else before deleting the old one and renaming the new one.  I also had to fix a whole bunch of inheritance errors since some classes couldn't figure out to point to the correct classes as their parents.

 

I think i need a better solution to store my classes and i had been looking for a good one in a previous post as well.  What i got out of that thread was to keep all the class directories flat and not to use a heirarchy with them so i have been doing that.  But i have found that to even use inheritance the classes have to be in some kind of a project (be it an actual project or an lvlib).  Is there any better way to get my classes to use inheritance without using something like this?  It creates a couple problems, like if i want to deploy my application and want to hide overridden VIs as dlls rather than just have them as .vi for someone to change i have to include the ENTIRE library into a project when i dont necessarily need all the classes.  If anyone has any suggestions i'm sure this would be a great discussion for anyone looking to start organizing their classes in a clean manner!

 

regards

 

Brent Schenk 

0 Kudos
Message 3 of 3
(2,701 Views)