Jump to content

Determining when a terminal is selected


david10

Recommended Posts

I'm new to scripting, and I am trying to determine when a terminal on a node has been selected.

For example, when my mouse hovers over a terminal on a node on the block diagram, the following things happen: a tip strip appears, a small black block flashes on the terminal, a larger black block flashes in context help if it's on, if I right-click "create constant, etc " appears in the menu. That is what I mean by "selected" in this context. The terminal of a constant can also be selected, but much less happens.

I thought the "selected" property of a terminal might return true when my mouse hovers as above but that doesn't happen. The "selected" propery always returns false unless I actually write a true to it before reading it.

The private property "BasicObjectFlags" of a terminal toggles between 0 and 16 while the terminal is flashing, but there must be a more straight forward way.

Thanks,

David

LabVIEW 8.6.1 and 2009

Link to comment
  • 4 weeks later...

David,

There currently is no real easy way to know what terminal is currently the 'active context'

BUT! there are a few different methods that have been implemented, one of which is in LabVIEW Speak that can spit out a terminal reference to whatever is currently hovered over on a specific VI.

Watch around minute 4 http://www.screencast.com/users/NJKirchner/folders/Jing/media/dd8c0257-e118-4819-b113-d434046b7c0c

If you install the tool, you'll find the Quick Edit Command plugin for creating at

C:\Program Files\National Instruments\LabVIEW 2009\resource\QuickEdit\Plugins\Create\Execute QEC.vi

from there you can find the function that takes a VI reference and spits out a terminal reference to whatever was hovered over (if anything is being hovered over)

<a href="http://content.screencast.com/users/NJKirchner/folders/Jing/media/32467ab6-d1e3-498e-882f-c123898f90ed/2010-09-10_1029.png"><img'>http://content.screencast.com/users/NJKirchner/folders/Jing/media/32467ab6-d1e3-498e-882f-c123898f90ed/2010-09-10_1029.png"><img class="embeddedObject" src="http://content.screencast.com/users/NJKirchner/folders/Jing/media/32467ab6-d1e3-498e-882f-c123898f90ed/2010-09-10_1029.png" width="788" height="367" border="0" /></a>

This VI is currently password protected and I forgot my password.....throwpc.gif

So I'll see if I can crack it back open and show the how's

Link to comment
  • 2 weeks later...

Norm,

I had stopped checking this thread and didn't see your reply until today.

I installed the packages, and looked where you directed me. The solution I saw was very similar to what I am currently doing. There is a difference, though, between this functionality and what I'm looking for.

In the LabVIEW editor a terminal can become "enabled" for wiring - as indicated by the cursor changing to a spool and the right-click context menu being available - even though the cursor is not within the terminal's Master Bounds Rectangle. There is leeway of about 5 pixels in each direction, so that the spool cursor can appear even though the cursor has never entered either the node or the node terminal's MB rectangle.

Since the editor has this information, presumably without the overhead of Traverse, I was wondering if there was a way to get it.

Thanks for showing me what you have. I'm going to give Speech a try tonight.

David

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
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.