LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LVOOPs Interface Class

Hi All,

 

I want to implement LV class interface concept in my project. Below is my class diagram. 

 

VipinrajKK_1-1587321718838.png

 

 

I have three different classes Class A&B, Class C&D, and Class F. Each classes are having a Method called Configuration. I need to use a common interface to call this method into a sub panel.

 

The concept is , If I pass the object of any of these classes into iSubpanel Class ,it should take care below functionalities

 

  • Calling the Configuration method of that object passed
  • Run Configuration.vi and insert into sub panel.
  • Update the values inside that object into the Configuration method.

 

Can anyone suggest me how to implement this in LVOOPs.

 

 

Vipinraj KK

CLA.png

 

 

 

0 Kudos
Message 1 of 7
(4,000 Views)

Are you doing this in the beta version of LabVIEW 2020? That contains OOP interfaces - so you can create what you've drawn in the diagram.

If not, I would recommend writing a subpanel class and putting a 'subpanel class' object as part of the other classes (encapsulation), then using bundle/unbundle to access it, from there you can use the subpanel class API.

 

That or...

 

You could have all the classes inherit from a 'User Interface class' that defines the subpanel methods. Tread carefully though - this can be a blessing or a curse.

0 Kudos
Message 2 of 7
(3,995 Views)

Hi,

 

Thanks for your quick reply.

 

I m using LV2018.

 

Actually I don't want to consider the subpanel reference as the property of my class.Because I m planing to maintain only properties related to that class as I need to use this same class reference in LabVIEW RT also. In my project I will do configuration in Windows and Execution in RT Target.Configuration is nothing but updating all the value into properties of that class and Execution actual functionality of that object.

 

Can you help me to make malleable VI and interface class to handle this. I m really not sure about these two.

 

Also I have already implemented the same as you suggested , Now I m optimizing by removing unwanted properties from class. I have properties like subpanel reference and Tree reference etc etc . I need to take out all these from these classes and optimize  it for better performance.So I m looking for something like interface concept.

0 Kudos
Message 3 of 7
(3,990 Views)

Hi All,

 

I m attaching the code here, Can you help me to debug why is not working, If i use malleable vi ,with only one object its working , But if i use a selector and try to connect all the object to that, its not opening the configuration vi. 

 

Also its not complete ,I need to insert the vi to sub panel , right now its a popup.

0 Kudos
Message 4 of 7
(3,923 Views)

Please take a look at Andrei's approach to interfaces in LabVIEW. There is a presentation pdf at the bottom of the page. I think his approach is the most useful one (to date). Perhaps you can get some ideas for your implementation there. Both GOOP and G# has their own implementations but as Andrei points out they are just not good enough for daily use.

 

Or simply wait until LabVIEW has interfaces.

Certified LabVIEW Architect
Message 5 of 7
(3,877 Views)

Thank you ,

 

I will go through the ppt.

0 Kudos
Message 6 of 7
(3,864 Views)

As McQuillan mentioned, LabVIEW 2020 has interfaces.

0 Kudos
Message 7 of 7
(3,193 Views)