04-18-2020 07:59 AM - edited 04-21-2024 09:52 AM
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:
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.
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).
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.
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.
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.
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.
04-19-2020 04:41 PM
Hi,
I will try this in the next few hours !
You probably should make a package with VIPM to share this !
Loïc.
04-20-2020 12:38 PM - edited 04-20-2020 12:38 PM
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!
12-07-2023 02:18 PM - edited 12-08-2023 01:54 AM
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
2.8.0.5
01-16-2024 03:23 AM
Is it possible to downgrade this package to LV2015?
01-20-2024 10:45 AM - edited 01-20-2024 10:46 AM
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:
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).
01-22-2024 02:59 AM
Everything working! Great job with this plugin!
Thanks,
JonA
01-23-2024 02:43 PM
Glad it worked!
And thanks 🙂
04-10-2024 03:04 PM
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.
04-21-2024 09:55 AM
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.