Jump to content

BD Selection Change Event


Recommended Posts

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.

post-27575-0-01892000-1367515592_thumb.p

Link to comment

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.

Link to comment

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?

Link to comment

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.