<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Subclasses inheritance in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980989#M1136070</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/102130"&gt;@Intaris&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/632706"&gt;@s.h._tech&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;It would be nice to unbundle the Elements of the 'Parent' directly in the 'Child'.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And this is precisely what you can't do.&lt;/P&gt;
&lt;P&gt;You create accessors for the parent, and use these inthe child isntead of direct cluster access.&lt;/P&gt;
&lt;P&gt;This is how it works.&lt;/P&gt;
&lt;P&gt;If you want to re-create all of the data in a child, then it's going to be really inefficient.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That means I need to create setter/getter methods in the parent to access the data of the parent in the child. So I need a extra method to extract data which should be inherited?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The whole reason of an abstract class structure is to have the same access to methods and variables of the superclass. The methods are usually tied to the variables defined in the superclass and the child wants direct access and not an extra getter method to acess the variable which is already defined in the superclass-subclass structure. This seems unnecessary complicated&lt;/P&gt;</description>
    <pubDate>Wed, 23 Oct 2019 10:18:48 GMT</pubDate>
    <dc:creator>s.h._tech</dc:creator>
    <dc:date>2019-10-23T10:18:48Z</dc:date>
    <item>
      <title>Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980601#M1135910</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have two classes "Datahandler.lvclass" and "Input.lvclass" and I am trying to understand the inheritance of the methods and variables.&lt;/P&gt;
&lt;P&gt;I can access data of the Parent class and add it to the 'Child' using the methods of the 'Parent' (syncdata.png)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="datatransfer.png" style="width: 986px;"&gt;&lt;img src="https://ni.lithium.com/t5/image/serverpage/image-id/254752iFDC86F4248F712D7/image-size/large?v=v2&amp;amp;px=999" role="button" title="datatransfer.png" alt="datatransfer.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Is there a way to add all the data (and references) from the 'Parent' (merge classes, sync)? I have some notifiers in the 'Parent' and I would like to activate them in the child (since they have the same data but not the correct references)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also some methods from the 'Parent' are not allowed to pass the datalines from the 'Child' (datatransfer_broken.png).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="datatransfer_broken.png" style="width: 999px;"&gt;&lt;img src="https://ni.lithium.com/t5/image/serverpage/image-id/254753iC410BA1D0BD9C86C/image-size/large?v=v2&amp;amp;px=999" role="button" title="datatransfer_broken.png" alt="datatransfer_broken.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Is there a special classification to pass them to the child? The method from the picture above seems to have no problem passing the datalines and are created using the same template (create using dynamic dispatch vi&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 07:17:09 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980601#M1135910</guid>
      <dc:creator>s.h._tech</dc:creator>
      <dc:date>2019-10-22T07:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980608#M1135914</link>
      <description>&lt;P&gt;I'm not exactly sure what you're asking for so I'll describe some aspects of inheritance, hopefully it will help or at least lead you to describe what you want that I missed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;All classes have private data. Nothing that is not part of the class can directly access this (MyClass.ctl contents)&lt;/LI&gt;
&lt;LI&gt;Classes can create accessor methods (this can be done by choosing New &amp;gt; VI for Data Member Access). This allows something else to access (read or write or both) the private data elements&lt;/LI&gt;
&lt;LI&gt;VIs (and controls) in a class have access scope: Public, Private, Community or Protected
&lt;UL&gt;
&lt;LI&gt;Public means anything can use it&lt;/LI&gt;
&lt;LI&gt;Private means nothing can use it from outside of that class&lt;/LI&gt;
&lt;LI&gt;Community means only this class, or friends of the class (configured via the Properties page of the class) can access it&lt;/LI&gt;
&lt;LI&gt;Protected allows the class, or any children of the class, to access the method. This could be a good choice for e.g. &lt;A href="https://en.wikipedia.org/wiki/Template_method_pattern" target="_self"&gt;template method patterns&lt;/A&gt;.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Children cannot generally access the data of their parents directly. They&amp;nbsp;&lt;EM&gt;can&amp;nbsp;&lt;/EM&gt;make use of Protected data access VIs.&lt;/LI&gt;
&lt;LI&gt;A public/protected VI can provide whatever data you want (from the parent) and be used by the child to get that data.&lt;/LI&gt;
&lt;LI&gt;A wire has a specific type. If I wire two different children into a Build Array node, the wire type at the output is &amp;lt;array of parent.lvclass&amp;gt;.&lt;/LI&gt;
&lt;LI&gt;If the wire type is a Parent.lvclass, then VIs specific to the child (i.e. not dynamic dispatch defined in the parent) cannot be called without a "&lt;A href="https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/functions/to-more-specific-class.html" target="_self"&gt;To More Specific Class&lt;/A&gt;" node.
&lt;UL&gt;
&lt;LI&gt;This is because the wire type doesn't know anything about that VI (it is a member of the child, not the parent)&lt;/LI&gt;
&lt;LI&gt;It doesn't matter if the actual object on the wire is/might be a child1.lvclass, you still can't call Child1.lvclass:MyStaticVI.vi (at least without To More Specific)&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Does this help at all?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2026 19:00:48 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980608#M1135914</guid>
      <dc:creator>cbutcher</dc:creator>
      <dc:date>2026-03-18T19:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980611#M1135916</link>
      <description>&lt;P&gt;That helped a lot.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now my only problem is the initial synchronization. I write some data in the 'Parent'&amp;nbsp; (defined in Parent.ctl). Is there a way to get whole Cluster and not all the indiviudal elements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I unbundle the Parentdataline (in a dynamic dispatch method) I only get the individual elements and not the Cluster with all elements. I would like to transfer all the Parent data to the Child and not make individual lines for every entry&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 07:55:18 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980611#M1135916</guid>
      <dc:creator>s.h._tech</dc:creator>
      <dc:date>2019-10-22T07:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980613#M1135918</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/632706"&gt;@s.h._tech&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;When I unbundle the Parentdataline (in a dynamic dispatch method) I only get the individual elements and not the Cluster with all elements. I would like to transfer all the Parent data to the Child and not make individual lines for every entry&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then don't unbundle it. &lt;span class="lia-unicode-emoji" title=":winking_face_with_tongue:"&gt;😜&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can make accessor on cluster level or even make custom ones.&lt;/P&gt;
&lt;P&gt;/Y&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 08:00:25 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980613#M1135918</guid>
      <dc:creator>Yamaeda</dc:creator>
      <dc:date>2019-10-22T08:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980614#M1135919</link>
      <description>&lt;P&gt;You could create a typedef containing a cluster that contains all of the elements, and then either directly place that cluster inside the class data of the parent (adding an extra unbundle all the time) or alternatively add a static dispatch method that unbundles the elements individually, then bundles them into this typedef'd cluster, and returns that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second option (not necessarily better):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="example.png" style="width: 999px;"&gt;&lt;img src="https://ip1.i.lithium.com/8948230f9b876b4ba6130d86bd5ce2d213c254d7/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32353437353569334642394337313142413646333336352f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="example.png" alt="example.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 08:06:16 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980614#M1135919</guid>
      <dc:creator>cbutcher</dc:creator>
      <dc:date>2019-10-22T08:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980617#M1135920</link>
      <description>&lt;P&gt;That means I have to add every value from the Parent manually to the child?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 08:13:21 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980617#M1135920</guid>
      <dc:creator>s.h._tech</dc:creator>
      <dc:date>2019-10-22T08:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980620#M1135921</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/632706"&gt;@s.h._tech&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;That means I have to add every value from the Parent manually to the child?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hmm, no. Probably not, anyway. What do you want to do with the values, once you have them in the child?&lt;/P&gt;
&lt;P&gt;You initially mentioned notifiers, so there are possibly alternatives (like using a parent VI that can be called by the child, and passing appropriate data or state from child to parent).&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 08:21:52 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980620#M1135921</guid>
      <dc:creator>cbutcher</dc:creator>
      <dc:date>2019-10-22T08:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980643#M1135929</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/632706"&gt;@s.h._tech&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;That means I have to add every value from the Parent manually to the child?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What? no.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Every Child is also a parent. If you add everything from the parent to the child you now have it twice. Once in the parent and once in the child.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Think of it in terms of clusters. You have a cluster which contains data. This is your parent. Now you make a child. The cluster for the child contains also data (different to the parent) but also a data field which represents the parent. The trick is that you don't have DIRECT access to this data field as a child, but your Parent implements accessory to grant you access. If you need tha data from the parent, use parent accessors. Don't double-up your data fields.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 09:34:02 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980643#M1135929</guid>
      <dc:creator>Intaris</dc:creator>
      <dc:date>2019-10-22T09:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980646#M1135930</link>
      <description>&lt;P&gt;They are just there for initialization.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think I figured it out:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Initial values are copied manually from parent to child&lt;/LI&gt;
&lt;LI&gt;All parentmethods that do not allow the childclass wire are newly generated (dynamic dispatch vi again) and for some reason they now allow the childwire (maybe a bug, or because it was generated &lt;U&gt;before&amp;nbsp;&lt;/U&gt;the subclass methods)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 09:58:10 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980646#M1135930</guid>
      <dc:creator>s.h._tech</dc:creator>
      <dc:date>2019-10-22T09:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980651#M1135931</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/632706"&gt;@s.h._tech&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;They are just there for initialization.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think I figured it out:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Initial values are copied manually from parent to child&lt;/LI&gt;
&lt;LI&gt;All parentmethods that do not allow the childclass wire are newly generated (dynamic dispatch vi again) and for some reason they now allow the childwire (maybe a bug, or because it was generated &lt;U&gt;before&amp;nbsp;&lt;/U&gt;the subclass methods)&lt;/LI&gt;
&lt;/UL&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It doesn't really sound like you're figured it out to be honest.&lt;/P&gt;
&lt;P&gt;If you have initialisation for a parent which is only setting internal values then use the parent method for the child.&lt;/P&gt;
&lt;P&gt;If your child needs a different initialisation, make a separate method for the child. Then call one after the other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you post some example code of what you're trying to do?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 10:09:48 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980651#M1135931</guid>
      <dc:creator>Intaris</dc:creator>
      <dc:date>2019-10-22T10:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980672#M1135941</link>
      <description>&lt;P&gt;I initialize the parent with some values and then create a setter method to copy the parentdata to the child. I hope there is an easier way, because my parent holds a lot of data&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 11:49:51 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980672#M1135941</guid>
      <dc:creator>s.h._tech</dc:creator>
      <dc:date>2019-10-22T11:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980683#M1135946</link>
      <description>&lt;P&gt;I see your mistake.&lt;/P&gt;
&lt;P&gt;Just use the parent methods on the child wire.&lt;/P&gt;
&lt;P&gt;You can call parent methods on Parents, children, grandchildren.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="The lower of the two is the better option - much more efficient" style="width: 434px;"&gt;&lt;img src="https://ip1.i.lithium.com/cb3d5a6fe44e25c05ff148175d2edfb57ea8728d/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32353437363769344530433532323637313346303544302f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="Untitled.png" alt="The lower of the two is the better option - much more efficient" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;The lower of the two is the better option - much more efficient&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You're overcomplicating things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Shane&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 12:21:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980683#M1135946</guid>
      <dc:creator>Intaris</dc:creator>
      <dc:date>2019-10-22T12:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980689#M1135949</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/632706"&gt;@s.h._tech&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I initialize the parent with some values and then create a setter method to copy the parentdata to the child. I hope there is an easier way, because my parent holds a lot of data&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why?&amp;nbsp; Just create an Initialize for the child and make it "Call Parent Method".&amp;nbsp; You will need to have the connector panes match, but Dynamic Dispatch will do all of the work for you.&amp;nbsp; Attached is an update to your project showing how this works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But what you seem to be trying to do is not inheritance, but composition.&amp;nbsp; Composition is when an object contains another object in its private data.&amp;nbsp; So what exactly is the relationship you are trying to make here?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 12:40:46 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980689#M1135949</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2019-10-22T12:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980903#M1136036</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/102130"&gt;@Intaris&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="The lower of the two is the better option - much more efficient" style="width: 434px;"&gt;&lt;img src="https://ip1.i.lithium.com/cb3d5a6fe44e25c05ff148175d2edfb57ea8728d/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32353437363769344530433532323637313346303544302f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="Untitled.png" alt="The lower of the two is the better option - much more efficient" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;The lower of the two is the better option - much more efficient&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I need to do the first option, because there are more VIs called before the parent is ready to transfer the data to the child.&amp;nbsp;The calling of the parent methods works. At least for methods created after the children. The older methods are not always recognized, but when I create a new dynamic dispatch and copy the whole VI it works for some reason.&amp;nbsp;The classic inheritance works now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to access all the data from the parent defined in parent.lvclass without creating a cluster in the definition of the class (which is already a cluster). But this has more cosmetic and accessibility reasons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 05:43:43 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980903#M1136036</guid>
      <dc:creator>s.h._tech</dc:creator>
      <dc:date>2019-10-23T05:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980923#M1136043</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/632706"&gt;@s.h._tech&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/102130"&gt;@Intaris&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="The lower of the two is the better option - much more efficient" style="width: 434px;"&gt;&lt;img src="https://ip1.i.lithium.com/cb3d5a6fe44e25c05ff148175d2edfb57ea8728d/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32353437363769344530433532323637313346303544302f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="Untitled.png" alt="The lower of the two is the better option - much more efficient" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;The lower of the two is the better option - much more efficient&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I need to do the first option, because &lt;FONT color="#FF0000"&gt;there are more VIs called before the parent is ready to transfer the data to the child&lt;/FONT&gt;.&amp;nbsp;The calling of the parent methods works. At least for methods created after the children. &lt;FONT color="#0000FF"&gt;The older methods are not always recognized, but when I create a new dynamic dispatch and copy the whole VI it works for some reason.&amp;nbsp;The classic inheritance works now.&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Red point: Hmm... Why does the parent transfer data to a separate child object? You should just have a Child object, and store the necessary "parent-level data" in the same child object, using the Parent VIs (e.g. iniparent.vi).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Blue point: I'm confused what this means... I suspect at some point you've changed how you're creating something, perhaps from the wrong way to the right way, and now it's "working", but I'm still unsure what you're doing, so I'm not sure it's right! &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/632706"&gt;@s.h._tech&lt;/a&gt;&amp;nbsp;wrote:
&lt;P class="1571812337049"&gt;&lt;SPAN style="font-family: inherit;"&gt;I want to access all the data from the parent defined in parent.lvclass without creating a cluster in the definition of the class (which is already a cluster). But this has more cosmetic and accessibility reasons.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The way you talk about Children and Parent classes makes me wonder if you in fact need a "Composition" arrangement as was previously mentioned by crossrulz, or if you're missing a key point about LabVIEW objects.&lt;/P&gt;
&lt;P&gt;I know that when I first started using them, I also worked to place the entire parent object in the Child data using variants. When I later came back to that code, I was mystified as to what I'd been trying to do. My best guess is that I just hadn't understood dynamic dispatch very well! Some rework with the template pattern removed a large fraction of the code and made everything much cleaner.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Shane (Intaris) already mentioned (although not by name) the &lt;A href="https://en.wikipedia.org/wiki/Liskov_substitution_principle" target="_self"&gt;Liskov Substitution Principle&lt;/A&gt;, paraphrased as "every child&amp;nbsp;&lt;STRONG&gt;is-a&amp;nbsp;&lt;/STRONG&gt;parent", or similar phrases. If you have a "is like a" relationship, don't use inheritance.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LabVIEW only allows public inheritance, and currently (wink wink &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; ) doesn't have interfaces, so you can only correctly model "is-a".&lt;/P&gt;
&lt;P&gt;For other relationships, look to composition (i.e. put an object of one class in the private data of another class).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are your parent and child classes? Datahandler and Input? And how do they work (a description is probably fine).&lt;/P&gt;
&lt;P&gt;Based on the names, I'm not sure that "Input"&amp;nbsp;&lt;STRONG&gt;is-a&amp;nbsp;&lt;/STRONG&gt;Datahandler, or really that Datahandler&amp;nbsp;&lt;STRONG&gt;is-a&lt;/STRONG&gt; "Input", but perhaps that is indeed the case and I just haven't understood the meaning of the names correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are their respective initialization steps? Or rather, which VIs must you call on each object before you can use it? Do they share code, or purpose? Or does one just&amp;nbsp;&lt;STRONG&gt;use&lt;/STRONG&gt; the other (this is a composition/aggregate rather than inheritance relationship, usually).&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 06:42:37 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980923#M1136043</guid>
      <dc:creator>cbutcher</dc:creator>
      <dc:date>2019-10-23T06:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980933#M1136045</link>
      <description>&lt;P&gt;Thanks for the detailed answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the Childclass now allows the Parentmethods I would also think that something went wrong in the creation step. With the methods I created thus far I have no problems.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="getcluster.png" style="width: 986px;"&gt;&lt;img src="https://ip1.i.lithium.com/35c6a10949a6790c7152d439e2aa8486b487e7d2/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32353438313869323142464535333646383633453844332f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="getcluster.png" alt="getcluster.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only problem I have now is that I want to access all the data from the Parent.lvclass and not put in in another cluster (my real data consists of multiple clusters and I do not want a cluster in cluster in cluster structure). Then I can create a setter method and transfer all the parent data to the child.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 07:10:22 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980933#M1136045</guid>
      <dc:creator>s.h._tech</dc:creator>
      <dc:date>2019-10-23T07:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980935#M1136046</link>
      <description>&lt;P&gt;Have just been skimming the conversation, but "&lt;EM&gt;transfer all the parent data to the child&lt;/EM&gt;", that should never be needed. Either there is a misconception or the design is incorrect. You simply access data from the parent class from the child class. When you are running the code, the created sub-class object has/can access parent class data, without transferring anything to the child (depending on access, which needs to be protected-scoped for parent-&amp;gt;child access).&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 07:18:49 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980935#M1136046</guid>
      <dc:creator>thols</dc:creator>
      <dc:date>2019-10-23T07:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980936#M1136047</link>
      <description>&lt;P&gt;From the code you just attached and the block diagram you show in your reply, you could now use the idea I suggested some time ago with a separate typedef'd cluster, not used in the private data, but only as an output. This would in your example be {Numerisch, Boolesch}.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't want to bundle data specifically for output (not inside the private data, but in the accessor methods like "getparentdata.vi"), and you don't want separate accessors ("Get Numerisch.vi", "Get Boolesch.vi") then you must instead consider alternative ways to get/use the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You talk about a Setter method to set the data in the child, but it's still not clear why you're trying to do this. It's possible you feel like this is obvious, but it continues to escape me... Can you try explaining it some more?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Further, following my descriptions above, are you happy that your Child&amp;nbsp;&lt;STRONG&gt;is-a&lt;/STRONG&gt; Parent?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 07:22:33 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980936#M1136047</guid>
      <dc:creator>cbutcher</dc:creator>
      <dc:date>2019-10-23T07:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980946#M1136053</link>
      <description>&lt;P&gt;The 'datahandler' is the super class. I do some calculation, file manipulation, setting values that all 'Children' need. After the 'datahandler' has finished its initialization I create the 'Children' are created. These children now need the values of the 'Datahandler' (which where created earlier).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/338532"&gt;@cbutcher&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;From the code you just attached and the block diagram you show in your reply, you could now use the idea I suggested some time ago with a separate typedef'd cluster, not used in the private data, but only as an output. This would in your example be {Numerisch, Boolesch}.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I will use this method. I am used to have direct access to all variables of the super class without the need to implement specific setter methods from the parent (they share the same set of variables declared in the super class). It would be nice to unbundle the Elements of the 'Parent' directly in the 'Child'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/338532"&gt;@cbutcher&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;Further, following my descriptions above, are you happy that your Child&amp;nbsp;&lt;STRONG&gt;is-a&lt;/STRONG&gt; Parent?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A parent for which class? In this example?&amp;nbsp; A child can have a child (with all the methods and variables of the parent -&amp;gt; grandchild), but I dont think I did it here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 07:49:25 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980946#M1136053</guid>
      <dc:creator>s.h._tech</dc:creator>
      <dc:date>2019-10-23T07:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Subclasses inheritance</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980951#M1136057</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/632706"&gt;@s.h._tech&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;It would be nice to unbundle the Elements of the 'Parent' directly in the 'Child'.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And this is precisely what you can't do.&lt;/P&gt;
&lt;P&gt;You create accessors for the parent, and use these inthe child isntead of direct cluster access.&lt;/P&gt;
&lt;P&gt;This is how it works.&lt;/P&gt;
&lt;P&gt;If you want to re-create all of the data in a child, then it's going to be really inefficient.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 08:08:14 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Subclasses-inheritance/m-p/3980951#M1136057</guid>
      <dc:creator>Intaris</dc:creator>
      <dc:date>2019-10-23T08:08:14Z</dc:date>
    </item>
  </channel>
</rss>

