LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

has anyone had any issues with classes from different libraries inheriting from each other

Hi,

 

i have a slew of 25 or so classes that i have kept in one .lvlib.  Most of the classes are drivers i've written for various measurement instruments.  As of today I am tired of writing simple one vi programs that needs a class from that library and the whole library gets included in the project file along with the compiled executable.

 

I know this setup might not be the best setup but it is what worked for me.  My top level ancestor class for most of the classes was called 'test hardware.lvclass'  it had three variables in it, VISA, IP Address, and Port.  As one can imagine, i only needed to use VISA or IP and port.  I want to go away from this huge hierarchy ending with this single ancestor class.  The reason i have had them all in the same library is because i was under the impression that LabVIEW classes had to be in the same library to inherit from each other.  I have found from testing now, that is not the case. 

 

So for those of you who i have worked with classes and large hierarchies spanning multiple libraries what issues should i watch out for if i were to start separating these classes into different libraries and inheriting from classes in other libraries?  I'm not sure this is best way to go but it is something i am investigating.  Also, i could get rid of test hardware and just give each piece its connection information but i'm not sure thats the way i want to go either.  Does anyone have any thoughts on this?

0 Kudos
Message 1 of 4
(2,033 Views)

I really like the new library option becuase it cleans-up my hiearchy and let me colapse the nonsense classes to let me focus on the task before me.

 

The only "issue" was minor and other may not even care.

 

The "Issue" was recursive lbrary calls. Example

 

Library A calls into Library B tht in turn calls into Library C that uses a function from Library A. You end up with recursive calls in the hiearachy screen (dotted line going back up the screen) and I did not like how it looked.

 

As long as your private/protected/public scope is sett properly, I know of no issues.

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 4
(2,032 Views)

Ben,

 

thanks for your input, im going to quickly separate them out and see how that might work.  I'm really trying to refactor my code the right way, we are switching from clearcase (UGH) to GIT (YAY) for source control and I want to get it into GIT correctly the first time.

0 Kudos
Message 3 of 4
(2,028 Views)

I would like to hear about any issue you may run into while doing the change over. Scarse littel has been posted on the topic and I would appreciate learning about the challenges, if any.

 

Thank you!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 4
(2,007 Views)