Jump to content
Sign in to follow this  
DanielChile

"Wired" property?

Recommended Posts

Hi all. I was wondering if it exists a "wired?" property (or something like that), so you can programmatically know from a subVI if certain control is wired or not (on the top VI diagram).

Am I clear?

Thank you.

Daniel Ramírez

CADETECH S.A.

Share this post


Link to post
Share on other sites

As far as I know, there isn't (at least there wasn't in 7.1. It may have been added as a private property in 8.x).

You can do something like this instead.

Share this post


Link to post
Share on other sites

QUOTE(yen @ Aug 28 2007, 02:50 PM)

Thanks for the answer. However, I was thinking about a boolean control, so there is no choice for "invalid" values.

DR

Share this post


Link to post
Share on other sites

QUOTE(DanielChile @ Aug 28 2007, 11:51 AM)

Hi all. I was wondering if it exists a "wired?" property (or something like that), so you can programmatically know from a subVI if certain control is wired or not (on the top VI diagram).

No such property exists in LV8.5.

Share this post


Link to post
Share on other sites

QUOTE(Aristos Queue @ Aug 28 2007, 04:52 PM)

I thought about this a little while this morning (needed a break from my other project). I ended up coming up with a way that I think works, and it tested well on LV7.1.1, LV8.2.1, and LV8.5.

Let me know if anyone has a better way, or a suggestion for improving this VI:

http://forums.lavag.org/index.php?act=attach&type=post&id=6814''>http://forums.lavag.org/index.php?act=attach&type=post&id=6814'>http://forums.lavag.org/index.php?act=attach&type=post&id=6814 (LV7.1.1)

The reason there are three VI's here in this ZIP file is so I could test the real world behavior when the ConPane_Wired.vi is used on the BD of a VI that is being called from another VI (where one of the terminals is either "wired" or "not wired").

Run the "ConPane_Wired_TESTVI.vi" to see it in action.

Share this post


Link to post
Share on other sites

I like the fact that you were able to work around this. :thumbup:

The two main issues I can see with this approach is that you would need to parse all the diagrams in the VI in order to find the subVI, not just the main diagram, and that it relies on the name, which could be duplicate (although in most cases people would probably not use duplicate names).

Share this post


Link to post
Share on other sites

QUOTE(orko @ Aug 31 2007, 08:33 AM)

Not sure what you mean here. Wouldn't getting all of the subVI's from the caller's caller's BD SubVIs[] property be sufficient to find the subVI? I thought we were just trying to see if this instance of the VI that has the ConPane_Wired.vi in it has a particular terminal wired?

A.vi has B.vi in it. B.vi calls C.vi to find out if terminal t is wired. C.vi would search A.vi's block diagram for B.vi to get to it's terms[] property to find terminal t. Is there a better way?

Yes. This was one of those things that bugged me, but I wasn't able to figure out another way to do it. :P Any ideas?

The problem, I believe, is that the search only looks in the base diagram. It does not look in any structures (while loops, case structures, etc.). There is a VI in vi.lib for traversing the diagram hierarchy. That should do the trick.

On the topic of the name, would this also break if there was more than one instance of the subVI on the block diagram? Wouldn't it always stop on the first instance found, rather than search until it found the correct instance?

David

Share this post


Link to post
Share on other sites

QUOTE(dsaunders @ Aug 31 2007, 02:45 PM)

Ah. Okay. That's easy to fix. Thanks!

QUOTE(dsaunders @ Aug 31 2007, 02:45 PM)

On the topic of the name, would this also break if there was more than one instance of the subVI on the block diagram? Wouldn't it always stop on the first instance found, rather than search until it found the
correct
instance?

Good.............point :headbang:

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.