[Originally published on 2018-08]
This time the article is mostly for LabVIEW newcomers – just, I’d like to share couple interesting points of how you could make LabVIEW programming easier, funnier and faster. So, here we go.
- Swap inputs
What if you have function with two inputs, and then you need to swap input wires? Deleting wires is boring and slow – instead, just press Ctrl, move mouse pointer to one of the inputs, and when cursor will have scissors icon, press left mouse button. Input wires will be swapped.
- Edit enum/ring values
Instead of going to context menu -> Edit Items…, just hold Ctrl + click into enum/ring. Cursor will appear there, and you can enter new values. To create next value, just press Shift + Enter.
- Replace with Case Selector
If one will click on tunnel going into case structure, it is possible to change it to case selector: right-click on the tunnel -> select “Replace with Case Selector”. This function is extremely useful during code refactoring, when one wants to wrap code into error case structure.
- Case Insensitive Match
If we talk about case structures, one should remember that in case of string case selector it is possible to set insensitive match, when string upper/lower case does not matter. Just right-click on the case structure, and select “Case Insensitive Match”. Then, icon “A=a” will appear in the lower left corner, as the following:
- Scroll structure pages
Basic functionality, but not obviously visible at the first sight – if you’ve got multipage structure (like Case Structure, or Event Structure), you could scroll between pages as the following: hold Ctrl key, and use mouse scroll button.
- Resize structure (block diagram)
Everyone knows, that you could resize block diagram (make bigger spacing/expand structure) by holding Ctrl key, pressing left mouse button and moving it into desired direction. But how to make size smaller? Just hold keys Ctrl + Alt, press left mouse button – and you’ve got red arrows, so it is possible to make structure smaller, or decrease spacing between elements!
- Connect wire through all structure pages
This is also well-known functionality, but anyway, I can’t not to mention it. Sometimes there is need to connect wire through all the structure pages. And it is very easy – just connect wire through the first page, then right-click on the left wire tunnel -> Linked Input Tunnel -> Create & Wire Unwired (Cases). From now on, when you add new page to the structure, wire will be automatically connected through it, and you don’t need to do it manually.
- For Loop iteration parallelism
To improve performance, and to parallelize code as much as possible, LabVIEW offers option to configure For Loop Iteration Parallelism. Just right-click on For Loop -> Configure Iteration Parallelism… -> and in the opened window enable the functionality, set number of parallel loop instances, and other options. This functionality also has some caveats – so just go through this article, http://www.ni.com/tutorial/9393/en/.
But, moreover – LabVIEW helps to find For Loops in your code, which you may parallelize. Just go to LabVIEW menu toolbar, and select Tools -> Profile -> Find Parallelizable Loops…
The same, actually, you could do with VI Analyzer tests.
- 2D array size
Simple tip, which could save your block diagram space. If you need to get 2D array size, don’t do Array Size -> and then Index Array to get Number of Rows and Number of Columns. Instead, use Matrix Size function. Just compare the following code:
- Quick drop shortcuts, quick drop plugins, shortcut menu plugins – and other plugins =)
Yes, these tools really, really help a lot. And if you don’t use them – you must start to do it right now. Beauty is, that you may add your own shortcuts, plugins – and customize LabVIEW development environment as much as you want. And moreover, you will boost your productivity so much as you didn’t expect.
“How to remember all those shortcuts?” – you may ask. Easy – just print them out (get list of shortcut from LabVIEW.ini file), put on the wall in front of you, and mark those which you’ve used the most. In couple weeks you’ll remember most common shortcuts without any problems!
Regarding quick drop plugins and shortcut menu plugins (which are available since LabVIEW 2015), just catch these links:
https://forums.ni.com/t5/Quick-Drop-Enthusiasts/gp-p/grp-1251 – Quick drop enthusiasts group
https://forums.ni.com/t5/LabVIEW-Shortcut-Menu-Plug-Ins/tkb-p/3013 – LabVIEW Shortcut Menu Plug-Ins
Well, that’s it. Hope, that this article was somehow interesting and useful for you. Thank you for your time, and looking forward for any feedback and comments!