Jump to content
Sign in to follow this  
Dan Bookwalter

Dynamic Dispatching VI's within a sub panel

Recommended Posts

can a DD vi be inserted into a sub panel ???

thanks

Dan

Well , never mind I answered my own question ..... as usual i figure it out AFTER i send off a request ....

Dan

Share this post


Link to post
Share on other sites

QUOTE (Dan Bookwalter @ May 14 2008, 01:12 PM)

Well , never mind I answered my own question ..... as usual i figure it out AFTER i send off a request ....

When you answer your own question it is always nice if you post the answer so those who come along with the same question can see what you figured out.

Share this post


Link to post
Share on other sites

QUOTE (Dan Bookwalter @ May 14 2008, 03:12 PM)

can a DD vi be inserted into a sub panel ???

As I've mentioned before: A VI that does dynamic dispatching is just a plain VI with a mark on its conpane. The Control VI or the Global VI -- these are special types of VIs. But there is not a "dynamic dispatch VI" type. To the best of my knowledge, there are only two places that dynamic dispatch VIs cannot be used that you can use a static dispatch VI: as one of the VIs inside a polymorphic VI and as the VI called by a Call By Reference node.

Share this post


Link to post
Share on other sites

The only way to get the right clone instance of right dynamic dispatch VI to a subpanel is to ask the VI reference or the clone name from the dynamic dispatch VI itself. First assume you have a class hierarchy with multiple dynamic dispatch VIs of the same name in the hierarchy. Any one of those VIs can be called when the dynamic dispatch VI subVI node is executed so you cannot use static linking to some specific VI. Also, if the dynamic dispatch VI is reentrant, then also any clone instance of any of those dynamic dispatch VIs in the hierarchy can be called when the dynamic dispatch VI subVI node is executed. As a result, you cannot use open VI reference based linking to any specific VI unless you also know the VI clone name. The only way you can get either the VI reference or the clone name is to ask the dynamic dispatch VI being executed to return it to you somehow while it executes. You can for example use a single element queue to pass the VI reference asynchronously from the dynamic dispatch VI to the calling VI. At least that's what I would do.

Share this post


Link to post
Share on other sites

QUOTE (Tomi Maila @ May 15 2008, 07:29 AM)

The only way to get the right clone instance of right dynamic dispatch VI to a subpanel is to ask the VI reference or the clone name from the dynamic dispatch VI itself. First assume you have a class hierarchy with multiple dynamic dispatch VIs of the same name in the hierarchy. Any one of those VIs can be called when the dynamic dispatch VI subVI node is executed so you cannot use static linking to some specific VI. Also, if the dynamic dispatch VI is reentrant, then also any clone instance of any of those dynamic dispatch VIs in the hierarchy can be called when the dynamic dispatch VI subVI node is executed. As a result, you cannot use open VI reference based linking to any specific VI unless you also know the VI clone name. The only way you can get either the VI reference or the clone name is to ask the dynamic dispatch VI being executed to return it to you somehow while it executes. You can for example use a single element queue to pass the VI reference asynchronously from the dynamic dispatch VI to the calling VI. At least that's what I would do.

Yes - I hadn't thought through the problem of reentrant dispatch members. My code did handle constructing a reference to the right version of the dynamic dispatch method, BUT, only if the method was implemented in all the classes. One could probably write code that traverses the class hierarchy looking for the correct dynamic dispatch method yo open a reference to, but it still falls over on reentrant vis. So, there doesn't seem to be a good way that avoids code in the embedded methods to handle doing the embedding. I think I'd probably would (and in fact will do) pass the reference to the subpanel control into the method and handle the embed and unembed within the dynamic dispatch method.

Share this post


Link to post
Share on other sites

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.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.