QueueYueue Posted May 2, 2013 Report Share Posted May 2, 2013 NI documentation: http://zone.ni.com/reference/en-XX/help/371361J-01/lvscript/vi_bd_selection_change/I'm working on creating a development tool. What I want is to be able to know when the user selects something new on the block diagram of the VI they're developing. This is my thought process: 1. Register for the VI Activation Event of the top level project. 2. Open a reference to newly selected VI. 3. Use the Register For Events node to register for the BD Selection Change on the VI ref that I just opened. 4. Perform my action on the new selection. Seems like it'll work, but if I Click on the block diagram of a VI in edit mode i get the following error from the Register Events node Error 1027, Saying "For the requested operation, the reference cannot be reserved as requested, is in an improper reservation mode, or the execution state must be set to running or reserved." I guess this isn't completely unexpected, it's not often you want to register for an event of a VI that's not running. This gets me thinking though, when will the BD Selection Change Event ever be used? You can't select something on the block diagram of vi that IS running, and you can't get events on a VI that ISN'T running. Am I missing something? See attached scratch code. Quote Link to comment
hooovahh Posted May 2, 2013 Report Share Posted May 2, 2013 Well this is an interesting one. I've seen this event before and I just never had a need for it so I never used it. I assumed it worked the same way you wanted to use it. I couldn't open your snippet (I believe Lava may have removed the meta data on upload) but I made a quick VI that was blank, and a new VI that opened its reference and tried to do what you did. Sure enough I got the same error 1027. I tried tricking the method a few ways because I noticed if the VI was running I could register for the event but couldn't select any thing on the block diagram. So I tried running the VI registering and then stopping it but that didn't work. I also tried the "Fake Exec State" posted on Lava, and that didn't work either. Quote Link to comment
Yair Posted May 3, 2013 Report Share Posted May 3, 2013 I didn't actually look at this (at least not recently. I do seem to have a vague recollection of trying it in the past), but my guess would be that this is a private event which was never fully implemented. Maybe someone wanted to do it but ran into problems or didn't have time. I'm assuming you have the superprivate keys in your INI file? Quote Link to comment
QueueYueue Posted May 3, 2013 Author Report Share Posted May 3, 2013 No super private keys turned on. This event shows up when you enabled scripting I believe. Quote Link to comment
Yair Posted May 5, 2013 Report Share Posted May 5, 2013 OK, you're right, the event does seem to be public and even has a help item. It was probably made public by accident, but since it is public, maybe now we can file it as a bug. 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.