Jump to content

Re-Label Wire Xnode (useful for event registration)


Recommended Posts

I put together a simple xnode to relabel event registration reference wires that feed into dynamic events of event structures.  With the increasing use of event based messaging systems, I found myself manually changing the name of event registration references to clarify the event name when multiple event registration references were used in an object. I did this by manually creating a cluster constant on the build cluster before the dynamic registration terminal on the event structure and renaming each registration reference.  Being a lazy programmer, this seemed tedious after a few times so I decided to attempt to create an Xnode to accomplish the same thing faster.   This video shows the "problem" and the potential solution using the xnode: 

Re-Label Xnode - Event Registration

Here's another example showing another use case with ShaunR's VIM HAL Demo code:

Re-Label Use Case ShaunR HAL Demo

This may have been done before or there may be an easier way to do this, but I wanted to throw it out here to see if there's any interest and to see if people will try it out and give feedback.  I've found it works best using quick drop for initial use (highlight wire, CTRL-Space,type re-label, CTRL-I, type new name in dialog) and for replacing or renaming an existing instance on the diagram (highlight existing xnode, CTRL-Space, type re-label, CTRL-P, type revised name in dialog).  You can also use directly from the palette, but I found much faster from quick drop and also seen a couple crashes replacing through the pallete.  

The Double Click ability is also a work in progress.  Its purpose is to allow you to quickly rename the relabel with the same dialog box, but when it executes it breaks the wire on the output connection.  You can still re-wire it to the event structure, but you will have to open the Event Structure Edit Events menu to get the event to "Re-link".  Something I'm trying to avoid.

The Xnode generated code is simply a pass through wire with the output terminal renamed to the label of your choice.  This seems to update attached event structures.

Relabel in HAL.png

- B

sobosoft_llc_lib_diagram_tools-1.0.4.1.vip

  • Like 2
Link to comment
  • 1 month later...
On 7/11/2016 at 9:30 AM, lordexod said:

New non-xnode update for "Re-Label Wire Xnode" popup plugin Relabelizer.llb , copy to ..\LabVIEW <version>\resource\plugins\PopupMenus\edit time panel and diagram.

lordexod.  I tried your new Relabelizer popup plugin and its a nice solution.  Seems to have a small bug that the terminals may not get wired up properly depending on where you right click to execute the script. See:

Relabilizer Plugin Bug

I still like my solution better :) because it looks better on diagram.  Yours is more elegant because of its simplicity though.

Link to comment
19 minutes ago, bbean said:

lordexod.  I tried your new Relabelizer popup plugin and its a nice solution.  Seems to have a small bug that the terminals may not get wired up properly depending on where you right click to execute the script. See:

Relabilizer Plugin Bug

I still like my solution better :) because it looks better on diagram.  Yours is more elegant because of its simplicity though.

I'm still waiting for you to modify the named event macro to be an xnode that labels the event ref the same as the indicator label and makes the need for the re-labeler in your example, moot :D  (Especially now that it looks like it won't be fixed in LV 2016)

Edited by ShaunR
Link to comment
On 7/15/2016 at 7:34 AM, ShaunR said:

I'm still waiting for you to modify the named event macro to be an xnode that labels the event ref the same as the indicator label and makes the need for the re-labeler in your example, moot :D  (Especially now that it looks like it won't be fixed in LV 2016)

Sorry, I'm a little tied up right now with work stuff.  maybe we could chat offline regarding what you want in detail, so I don't accidentally go off on a tangent when/if I do actually work on it.  I think what was stopping me in my tracks before was figuring out how to determine the "name" to put on the output control based on an upstream connection (input wire)

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.