DanielChile Posted August 29, 2007 Report Share Posted August 29, 2007 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. Quote Link to comment
Yair Posted August 29, 2007 Report Share Posted August 29, 2007 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. Quote Link to comment
DanielChile Posted August 29, 2007 Author Report Share Posted August 29, 2007 QUOTE(yen @ Aug 28 2007, 02:50 PM) 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 http://forums.ni.com/ni/board/message?board.id=170&message.id=249633' target="_blank">this instead. Thanks for the answer. However, I was thinking about a boolean control, so there is no choice for "invalid" values. DR Quote Link to comment
Yair Posted August 29, 2007 Report Share Posted August 29, 2007 Sure, just use false as the invalid value. :laugh: Quote Link to comment
Aristos Queue Posted August 30, 2007 Report Share Posted August 30, 2007 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. Quote Link to comment
orko Posted August 31, 2007 Report Share Posted August 31, 2007 QUOTE(Aristos Queue @ Aug 28 2007, 04:52 PM) No such property exists in LV8.5. 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. Quote Link to comment
Yair Posted September 1, 2007 Report Share Posted September 1, 2007 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). Quote Link to comment
orko Posted September 1, 2007 Report Share Posted September 1, 2007 QUOTE(yen @ Aug 31 2007, 05:39 AM) 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 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? QUOTE(yen @ Aug 31 2007, 05:39 AM) and that it relies on the name, which could be duplicate (although in most cases people would probably not use duplicate names). Yes. This was one of those things that bugged me, but I wasn't able to figure out another way to do it. Any ideas? Quote Link to comment
JDave Posted September 1, 2007 Report Share Posted September 1, 2007 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. 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 Quote Link to comment
orko Posted September 1, 2007 Report Share Posted September 1, 2007 QUOTE(dsaunders @ Aug 31 2007, 02:45 PM) 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. 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: Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.