Quick Drop Enthusiasts

cancel
Showing results for 
Search instead for 
Did you mean: 

Quick Drop plugin: create error structure

A LabVIEW Quick-Drop (QD) plug-in for drawing an error structure on the block diagram. It has slightly different functionality depending on what items (if any) are already on the block diagram as explained under the different "situation" headings below, but the general behaviour includes:

 

  • Creates a new case structure (optional - use shift key if structure not desired. Also, shift behaviour can be reversed in the config VI, see "Config settings" section of this post)
  • Creates a new error control and error terminal if not already present on the top-level diagram
  • Moves all control and indicator terminals present on the top-level diagram to position them on the left and right of the new case structure respectively. Also aligns each group
  • Wires the error control to the new case structure's selector terminal, and wires from the inside of the selector terminal through the error case to the error indicator
  • Connects the error control and error indicator to the connector pane - to the bottom-left and bottom-right nodes respectively

 

Situation 1 - code and error terminals already present

This situation was my main objective to handle. I use Edit->Create SubVI often, so it's common for me to be working on a VI that needs an error structure to be added, and for the control/indicator terminals to be tidied up. In this case, all block diagram items except control/indicator terminals on the top-level diagram get placed inside the new case structure. The existing error control and indicator terminals are used for the wiring step.

 

Orbital_1-1701979810789.png

 

 

Situation 2 - code already present, but no error terminals

This is similar to Situation 1, but there are no existing error control or indicator terminals on the top-level diagram before the plugin runs. Again, this is a situation I sometimes end up in after using Edit->Create SubVI. A new error control and indicator are created automatically. The style of the new controls is a config option, with the following available choices: Silver, Modern, Classic, NXG (if available in the LabVIEW version), or "LabVIEW default" (which attempts to use the settings from the LabVIEW ini file).

 

Orbital_0-1701979575511.png

 

 

 

 

Situation 3 - empty block diagram

The plugin also works on an empty block diagram as shown. The size of the case structure is a config option, and is defined in terms of percentages of the height and width of the visible block diagram.

 

screenshotOfBlank.png

 

 

Situation 4 - no error structure

The plugin can also be used in "terminal only" mode that doesn't create the error structure by using the shift key (i.e. ctrl+shift+e). This can be used as an alternative for any of the above cases.

In this mode, an error control and terminal are created if not present, they are wired into the bottom left and bottom right of the connector pane respectively, and the controls and terminals on the top-level block diagram are aligned around the other existing code on the left and right respectively.

 

Orbital_0-1701979406324.png

 

 

 

 

Config settings

Many of the plugin's config settings can be easily modified from within "ErrorDrawerConfig.vi". These settings include the style used for creating error controls, alignment type used for controls and indicators, and the spacings used between various elements.

 

screenshotOfConfig.png

 

Installation

Install "Error Structure Drawer" using JKI's VI Package Manager: VIPM. The VI package file is published through the VIPM Community, so it can be found within the VIPM browser. Alternatively, the VI package file is attached to this post.

 

VIPM will automatically install the plugin to the Quick Drop plugins folder:

<LabVIEW>\resource\dialog\QuickDrop\plugins

 

 

Other notes

The default shortcut from an open Quick Drop menu is Ctrl+e (e for error) if the error structure is desired, or Ctrl+shift+e without the structure.

Current version in the attachments: 2.10.0.

Developed in LabVIEW 2017.

 

I did see that someone else has made an error structure plugin, but that doesn't do the same tasks.

 

I'd be interested if this is useful to anyone else or any feedback in general - it's my first VI Scripting project and Quick Drop plugin (...or maybe second because this is V2).

EDIT 2020-04-20: updated the attached plugin to version 2.1. The update has fixed a bug where the plugin would fail if there were any control or indicators of type: array of clusters. Also improved the end result when control or indicators have a large vertical offset on the block diagram compared to the code that they are wired to - there should now be a much reduced chance of ending up with wire tunnels on the top or bottom borders of the error structure.

 

EDIT 2020-04-22: updated the attached plugin to version 2.2. The update further improved the end result when control or indicators have a large vertical offset on the block diagram compared to the code that they are wired to - removed the chance of ending up with wire tunnels on the top or bottom borders of the error structure.

 

EDIT 2021-02-19: I finally got around to packing this up for VIPM as per Loïc's suggestion.

 

EDIT 2021-02-20: the tool is now published through the VIPM Community (v2.2.0).

EDIT 2023-12-07: new version released (two new versions released on VIPM recently but I only just remembered to update here too so its a joint release from this thread's perspective - v2.9.1). These are the last of the planned updates. Adds a way to run without creating a structure (ctrl+shift+e), support for NXG controls, auto alignment configuration, improved wire routing etc. Full release notes on VIPM.

 

EDIT 2024-04-21: new version released (v2.10.0). As per feedback in this thread, rename package folder to start with "_", to stop LabVIEW looking for plugins in it. Also fix bug where package VIs and Controls were unintentionally visible in the palettes.

Message 1 of 10
(5,130 Views)

Hi,

 

I will try this in the next few hours !

 

You probably should make a package with VIPM to share this !

 

Loïc.

Message 2 of 10
(5,076 Views)

Hi Loïc, thanks for your reply. That's a good suggestion with VIPM - I'll do that at some point soon, but I think I'll wait a little just in case anyone has any feedback here first.

If you already downloaded the plugin - please see the new version (2.1) attached to my original post, which I just edited. I fixed a bug as described at the end of that post.

Let me know how you get on if you do try it out!

Message 3 of 10
(4,987 Views)

Original post in this thread has been edited to reflect the two updates to this plugin that I published in the last week or so on VIPM.

 

This marks the end of the updates that I had planned for the plugin.

 

Brief release notes below - fuller notes on VIPM.

 

2.9.1.8

  • Add terminal-only mode: omits creation of an error structure but carries out the plugin's other actions. Hold shift key to use terminal-only mode. Shift key behaviour can be reversed in the config VI if desired.

 

2.8.0.5

  • Add support for NXG error controls (only works for versions of LabVIEW with NXG controls available).
  • Add functionality to automatically revert to using Modern error controls if developer's primary and secondary control style choices don't exist.
  • Add automatic option for selecting control and indicator alignment, based on LabVIEW's default label positions.
  • Improve positioning of wires, particularly in cases where controls or indicators are higher or lower on the block diagram than the rest of the code.
  • Add cleaning of wires inside the case structure that are identified as being at risk of becoming overlapped with other wires as a result of running the plugin.
  • Fix issue where the process fails when either an error control or an error indicator, but not both, is present before running the plugin.
  • Increase default whitespace around and inside the border of the case structure. The plugin's whitespace values can be changed in ErrorDrawerConfig.vi.

 

 

 

Orbital_0-1702022064459.png

 

Message 4 of 10
(1,996 Views)

Is it possible to downgrade this package to LV2015?

0 Kudos
Message 5 of 10
(1,877 Views)

Hi Senkaki,

 

I don't have LV2015 so I think I can't make a package for that version.

 

I just did a backwards save of the VIs for LV2015 though - please see the zip attached to this post. After downloading, you'll need to:

  1. Unzip
  2. Put the contents (i.e. ErrorStructureDrawer.vi and the ErrorStructureDrawer folder) in your LV installation's plugin folder, which might be this if you are using 32-bit LV:

C:\Program Files (x86)\National Instruments\LabVIEW 2015\resource\dialog\QuickDrop\plugins

 

You might need to assign the quick drop shortcut manually too. Restart LabVIEW after doing the above steps, then bring up quick drop (ctrl+space) and click the "Configure..." button. From there, go to the "Ctrl-Key Shortcuts" tab. Hopefully you'll see "ErrorStructureDrawer" in the list and you can assign it whichever key you want (it uses "e" by default when installed via the package).

Message 6 of 10
(1,837 Views)

Everything working! Great job with this plugin!

 

Thanks,

JonA

0 Kudos
Message 7 of 10
(1,823 Views)

Glad it worked!

 

And thanks 🙂

0 Kudos
Message 8 of 10
(1,767 Views)

Great tool 🙂

 

Is it possible for you to move the supporting files in QuickDrop/plugins from ErrorStructureDrawer to _ErrorStructureDrawer. LabVIEW does a recursive scan for VI that is can use, unless they are either not top level in a .llb or start with a '_'. See here.

In theory doing this helps QuickDrop load faster on it's first call.

 

0 Kudos
Message 9 of 10
(1,272 Views)

Thanks!

 

I didn't know about the "_" before - that has now been changed and published (on VIPM, and attached to original post here). I've also removed the plugin from the palettes, it was never intended to be visible there.

Message 10 of 10
(1,191 Views)