Jump to content

Get *all* objects in the diagram


CharlesB

Recommended Posts

Hi, I'm willing to make numerous Call library function nodes reentrant.

Of course I thougth "scripting!" and started to code a VI that can find a CLFN, and make it reentrant.

But when I tried I realized that since they are everywhere in my VIs, I need a fucntion that can get all objects in a BD, by recursing in the structures, cases, sequences... Has anyone done that, or is there an easy way to do this? :question:

Thanks

Link to comment
Hi, I'm willing to make numerous Call library function nodes reentrant.

Of course I thougth "scripting!" and started to code a VI that can find a CLFN, and make it reentrant.

But when I tried I realized that since they are everywhere in my VIs, I need a fucntion that can get all objects in a BD, by recursing in the structures, cases, sequences... Has anyone done that, or is there an easy way to do this? :question:

Thanks

Easy enough to find them:

post-2800-1128605558.jpg?width=400

I'm not too sure how easy it'll be to make them reentrant (have not looked at it, even for a moment).

Link to comment
Easy enough to find them:

post-2800-1128605558.jpg?width=400

This routine will only work for CBR nodes that are directly on the block diagram. If they are located inside of other structures (like Case or Loop Structures), then they will not show up in the AllObjs[] list. You will need to recursively traverse the hierarchy of objects on the diagram, in order to make sure that you have looked in every location for the CBR functions. I don't have time to create an example; but I'll try to later, unless someone beats me to the punch.

Link to comment
You will need to recursively traverse the hierarchy of objects on the diagram, in order to make sure that you have looked in every location for the CBR functions. I don't have time to create an example; but I'll try to later, unless someone beats me to the punch.

That's what I'm currently doing, I will post this when I'm done.

Thanks to both of you

Charles

Link to comment
This routine will only work for CBR nodes that are directly on the block diagram. If they are located inside of other structures (like Case or Loop Structures), then they will not show up in the AllObjs[] list. You will need to recursively traverse the hierarchy of objects on the diagram, in order to make sure that you have looked in every location for the CBR functions. I don't have time to create an example; but I'll try to later, unless someone beats me to the punch.

Woops! I missed the obvious.

Attached is a VI that may come close to what you need however.

Download File:post-2800-1128613768.zip

Link to comment
Thank you! :thumbup:

Unfortunately I couldn't get it to work for my code (it doesn't find anything).

I coded and attached something that works for me, any comments/corrections are welcome :)

What you posted and what I posted are slightly different in that yours returns all objects found and mine just returns one reference to each of the Call Library Function Nodes found which is what I thought you said you wanted in your original post.

Hi, I'm willing to make numerous Call library function nodes reentrant.

Of course I thougth "scripting!" and started to code a VI that can find a CLFN, and make it reentrant.

But when I tried I realized that since they are everywhere in my VIs, I need a fucntion that can get all objects in a BD, by recursing in the structures, cases, sequences... Has anyone done that, or is there an easy way to do this?

I guess I took it too far.

Before I posted it I did run mine against a VI that had several Call Library function nodes in it and it did indeed pick them all out.

Link to comment
What you posted and what I posted are slightly different in that yours returns all objects found and mine just returns one reference to each of the Call Library Function Nodes found which is what I thought you said you wanted in your original post.

I guess I took it too far.

Before I posted it I did run mine against a VI that had several Call Library function nodes in it and it did indeed pick them all out.

I investigated a bit more, there are strange things in your VI; if the vi I'm gving in parameter is not opened, it finds nothing. If it is opened, it finds 2 Call Library Function Nodes over 6. I think it is because the recursion is not remembering every objects found in structures.

Link to comment
I investigated a bit more, there are strange things in your VI; if the vi I'm gving in parameter is not opened, it finds nothing. If it is opened, it finds 2 Call Library Function Nodes over 6. I think it is because the recursion is not remembering every objects found in structures.

Well, it is setup to remove duplicate references. (You only need to modify the 1st instance of a Call Library function node that you find.) After all, you cannot have one instance of a node setup to be reentrant and another setup to non-reentrant. Again I think I took it too far for you.

Link to comment

I downloaded WMassey VI and started playing with it to see if it worked properly. However I went off track and instead modified to recursively search subVIs for call library functions.

Note that the Call Library function refereces are not valid after the VI has been closed, so in this design you can only work with those nodes within the case structure.

Denis

Download File:post-1881-1128627159.vi

Link to comment

Here is a programming challenge: Make the traversal routine generic, such that it accepts a callback (plug-in) VI reference, which is passed each object reference during the traversal. Let the plug-in VI decide what to do with the object reference -- in this case, it will determine if the object is a CBR node, and add it to a list.

Link to comment
Here is a programming challenge: Make the traversal routine generic, such that it accepts a callback (plug-in) VI reference, which is passed each object reference during the traversal. Let the plug-in VI decide what to do with the object reference -- in this case, it will determine if the object is a CBR node, and add it to a list.

Excellent suggestion. I'll see what I can do.

Link to comment
Here is a programming challenge: Make the traversal routine generic, such that it accepts a callback (plug-in) VI reference, which is passed each object reference during the traversal. Let the plug-in VI decide what to do with the object reference -- in this case, it will determine if the object is a CBR node, and add it to a list.

Here is something I have been working on. The reason I started this was to try and create a better spell checker, but I haven't done much towards that end.

The concept here is much like Jim suggested, except that a different VI is called for each type of object reference. This dynamic calling is only being done to populate a table right now, but what I had envisioned was to call a dedicated VI for a specific object type to pull out any text that needs to be spell checked.

If explanations are required, let me know and I will post some

Link to comment
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.