Jump to content

Polymorphic VIs that Pop Up


Recommended Posts

Hi all, I'm somewhat new to Labview so excuse any ineptitude that may arise. I have a program that is centered around an array of Devices - they are various different object types that descend from an abstract Device class. I'm trying to make a VI that can call the correct method VI for a given device in this main list (in an object oriented way, of course). So far this has been fine for most VIs, but now I'm trying to make an overridden VI in each class that opens when called, like a dialog box. As of right now, calling the "Display Info.vi" (the VI in question) on a given device opens the Display Info VI from the Device class, which is basically just a blank, unimplemented VI and therefore useless. Are there some settings I need to check to enforce polymorphic behavior on this VI? Thank you for any info you can provide!

Link to comment

That's currently how I have it set up, the Device class has a dynamic dispatch VI called Display Info and the child classes (the classes that will actually have real objects) override it with a Display Info VI that pops up. The correct VI pops up if I drag the Display Info VI from one of the child classes to the block diagram and wire in a control of that specific type. But if I get a Device object from an array that could be from any of the child classes and wire it into the Display Info VI from the Device class, the Display Info from the Device class is the one that pops up (when the device/object in question is actually a child type). The Display Info from the Device class is just the basic new VI layout because I didn't plan on actually having any objects that were specifically Device type.

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.