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, 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.
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.
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:
The default shortcut from an open Quick Drop menu is Ctrl+E (E for Error).
Current version in the attachments: 2.2.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 with through the VIPM Community.
I will try this in the next few hours !
You probably should make a package with VIPM to share this !
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!