Example Code

Quick Drop: Insert In-Place Element structure with wire sensitive border nodes.

Code and Documents

Attachment


Summary:

This Quick Drop Plug-In inserts In-Place Element structures (IPEs) onto selected wires / wire branches. It adds wire-data-type dependant border nodes and may also wire the internal terminals (if the Shift key was pressed).

Function:

The plugin creates an undo-history and analyzes the selected wires on the block diagram. IPEs are inserted and the terminals rewired.

If only  branches of a wire have been selected, the plugin recognizes which path (from source to sink) the selected branch was on and only connects selected  branches to the output (right) side of the IPE while unselected branches  are connected (forked) at the input (left) side.

Steps to execute code:

  1. Place the contents of the file archive to: "C:\Program Files\National Instruments\LabVIEW 2010\resource\dialog\QuickDrop\plugins"
  2. Start LabVIEW 2010
  3. Make sure that a Ctrl-Key combination is assigned to the i.vi (I used 'I' because the plugin was originally developped on LV2009 without the insert functions and updated with new LV2010 features)
  4. Open the test-bench ("C:\Program Files\National Instruments\LabVIEW 2010\resource\dialog\QuickDrop\plugins\Insert IPE\test.vi")
  5. Select any wires / wire branches
  6. Execute Quick Drop ( Ctrl-Space-Ctrl-[Shift]-I )
  7. Watch the IPEs being inserted.

Screenshots:

screenshot.png

VI Snippet:

snippet.png

VI attached below

_________________________
CLA

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
vekkuli
Member
Member
on

Very useful resource, thank you!

 

The insertion didn't work with object wires for me (LV2015 SP1 64bit). Having very little idea of what I was doing I took a look at the type descriptors and added a case 0x1E under the refnum 0x70, which did the trick for me. Does it make sense to you?

 

qd_Insert_IPE_TermType2IPEType.png

Contributors