VI Server/Scripting Category Winner
Scripting was released in LabVIEW 8.6.1 by NI Labs and made its official debut (publicly exposed in palette in without additional addons) in LabVIEW 2010.
I love the fact it now native in LabVIEW as I find Scripting invaluable in creating tools to speed up my development processes and in reducing repetitive tasks (so I can spend time learning new stuff!).
One area in particular that I find Scripting very handy is in support for LVOOP.
This example comprises a bunch of actions I use all the time and was able to automate.
It is currently an example of what I like - but I hope to make it much more configurable in the near future.
This package includes Quick Drop and Tools Menu plugins.
So you can access this plugin thorough either way, depending on what you like best.
I recommend checking out the Video Demonstration section (below) as the you can easily and quickly see what the plugin does.
Here are some videos demonstrating the LVOOP Assistant plugin. There are links to more videos below.
Editing Icons (with Layer support): http://www.screencast.com/t/OwxyUtE9pWEz
Methods Sandbox: http://www.screencast.com/t/ZTJkOWQxYTQt
Here are some more videos demonstrating the LVOOP Assistant plugin.
Installation Help: http://www.screencast.com/t/70DD7mcN77
Launch from Quick Drop Plugin + LabVIEW 2009 example: http://www.screencast.com/t/wqNKObpFmHlR
Launch from Tools Menu + LabVIEW 2010 example: http://www.screencast.com/t/USN9RTOhyeYs
Unsaved Class (limited features explained): http://www.screencast.com/t/NTI0M2EzN
Rename LVOOP Front Panel Object Labels: http://www.screencast.com/t/NTZiZDg0Yj
Scoped Virtual Folders: http://www.screencast.com/t/MDcxODVmO
Create Constructor from Template: http://www.screencast.com/t/MTcwMWM5OT
Icon Transparency Support: http://www.screencast.com/t/NzhlYmQ1Y
LVOOP Assistant is a Tool designed to assist with setting up a LVOOP Class.
Parts of this plugin were designed to be use with method templates i.e. VIs that have Class In, Class Out
Therefore, for LVOOP templates, the following Connector Panes are supported (the # numbers relate to Scripting if you haven't seen them before):
#4815 - 4x2x2x4
#4833 - 5x3x3x5
#4834 - 6x4x4x6
#4835 - 8x4x4x8
See here to learn more about creating your own keyboard shortcuts using Quick Drop Plugins.
Steps to Execute Code
- Download the attached .zip file distribution
- Install both packages into VIPM (jgcode_rsc_qdp_lvoop_assistant-0.16-1.ogp, jgcode_rpk_ni_icon_editor_api>=2.1)
- This package has no other dependencies
- Restart LabVIEW (if open) to refresh Tool Menu
Installing into LabVIEW 2010
The source code for this example is in LabVIEW 2009 and therefore a recompile is necessary to optimise performance in later versions of LabVIEW.
It is recommended that you un-check Mass Compile VIs After Package Installation if installing into LabVIEW 2010 as it will take a long time.
However, the plugin itself is able to realise a new installation and self-compile in LabVIEW 2010.
Additionally this process has been optimised.
This only needs to happen once - after that the plugin runs as normal.
This package will install a quick drop plugin to LabVIEW\resource\dialog\QuickDrop\plugins
This package will install tools menu plugins to LabVIEW\project\JGCODE Tools\LVOOP Assitant
This package will install the support libraries to LabVIEW\vi.lib\addons\_JGCODE Toolkits\LVOOP Assitant
Persistant data is saved to \data\settings.ini (relative to support libraries directory)
Press Ctrl + Space to activate Quick Drop on a Class Method VI then press Ctrl + X to launch the LVOOP Assistant GUI
Ensure that the x.vi does not already exist as a Quick Drop Plugin otherwise this will overwrite it.
If so backup your x.vi before you install - if you do not have a x.vi Quick Drop plugin then do not worry!
Select this plugin from the Tools Menu: Tools >> JGCODE Tools >> LVOOP Assistant >> Run to launch the LVOOP Assistant GUI.
- Open a new Project
- Open a new Class
- Save the new Class to disk (this exposed more options in the plugin)
- Either create a new Class Method VI or open the Class Control
- Launch the LVOOP Assistant using Quick Drop or the through the Tools Menu
If you activate this tool on a non Class Member VI, the plugin will silently exit.
A VI Snipper is not applicable in this example as the deliverable is a LabVIEW plugin.
This distribution contains the Icon Editor API package. This Icon Editor API was released by National Instruments (namely through Thomas Sandrisser - ThSa). The original code (available here) has not been edited in any way, it has only been recompiled to sit natively under <user.lib> (not <User Desktop> as per the download) so it is a symbolic location. It has been included in a package so that it can be easily installed in LabVIEW. It is a great API that allows you to manipulate Icon Layers which related to the Enhanced Icon Editor, new to LabVIEW 2009. Check out the NI Community Group here.
Additionally I have extended the Icon Editor API package with my own code library (separate to the original code library) to include additional features such as a native interface for Classes and also functions that operator on the Layer Data. This package is a dependency of the LVOOP Assistant and not included in the build as the Icon Editor API calls code outside of LabVIEW symbolic paths (i.e. where the Icon Editor itself sits under <LabVIEW>\resource\plugins\NIIconEditor\etc...). This means that any calling code will break as the links will change from your src tree to dist location. The workaround for this was to keep all calls to this code under <user.lib> and separate in the Icon Editor API package.
I thought I would mention this as you may find the Icon Editor API useful and compliments this example.
I am hoping in the future that this API could be included natively with LabVIEW in a way that the above issues would no longer be a problem.
Please vote for this Idea on the Idea Exchange Forum to make this happen!
I love to share code therefore, an earlier version of this example has been previously release on LAVA however, according to Todd this is within the rules, given that the code is differentiated between versions. The main feature of release v0.16 is native support for LabVIEW 2010. The distribution code is LabVIEW 2009 but it will automatically handle an optimized mass-compile of the code on first call to speed up the tool (otherwise the code would compile each time the tool is loaded which is unacceptable as it quite a large distribution contains libraries/classes etc...)