Why LabVIEW? Part 1

By 4 July 2016LabVIEW

Add-ons and 3rd party software

 

In this series of articles I will describe some positive aspects of LabVIEW which let us use it as a primary programming environment and get us our things done. It is totally incomplete and subjective, but still an entertaining piece of reading, I hope. In this part I will depict how fun is extending LabVIEW functionality.

Let’s start with some matters which matter before we actually begin any application. We hardly ever use LabVIEW base capabilities only and usually need some extra hardware support and libraries related to a specific field of engineering or programming. So we install LabVIEW modules and toolkits. I had wondered what is the exact difference between a module and a toolkit since the beginning of my LabVIEW career, because on NI sites there is no clear distinction between them and all of them are called add-ons. Now from my observations I can shortly say that module is a big add-on made and licensed only by NI, not available in JKI’s VI Package Manager and toolkit is a small one made and licensed by anyone, available in VIPM.

LabVIEW Modules

I usually install them together with LabVIEW, because the set of modules we use is constituted, in contrary to our workstations. For everyone in our developer team a must-install are machine vision modules – Vision Acquisition Software and Vision Development Module. It gives us ability to acquire and process images from any camera fast and conveniently. Vision is our main domain, so they happen to be quite useful for us. There is also a decent set of modules suitable for other modern engineering fields, including Real-Time Module or Robotics Module.

Toolkits

There are also add-ons which can be made by anyone. In other programming languages 3rd party software usually means putting some effort in getting it working. Enough effort to make tutorials on how to install software, like in the case of OpenCV. Quite easy but still someone may need a tutorial. In LabVIEW we don’t need that, because there is only one IDE in which you can use LabVIEW 3rd party software and it’s LabVIEW. There is also only one proper source of such extensions and it’s LabVIEW Tools Network accessible through VIPM (which is by the way the best way, if not only, of installing toolkits). So, we just open VI Package Manager, select an extension, click install and it works. Out of the box, you may say, packages made by anyone are no problem. Another thing is that we have a good selection of the toolkits. Don’t reinvent the wheel, look for it first. One of our must-install tools in toolkits category is OpenG – a great extension for basic programming aspects – arrays, strings, etc. Developed by community. It’s like boost for C++. Independent and acclaimed.

JKI's VI Package Manager

Someone is about to install a database toolkit with VI Package Manager

Other 3rd party code

During our online search for solutions we can also come across some pieces of code which are not distributed as toolkits (with palette menus, documentation, etc.). Just VIs. No problem. If we have all needed dependencies and version of LabVIEW which is not lower than the version in which it was written, it will (just) work by selecting a VI through Functions Palette.

3rd party binaries

You can also run dynamic link libraries and executables in LabVIEW. To run exe files you just need to use System Exec VI. A few first uses demand some struggling with inputs, but then it becomes nice. With C-style dlls, to call their functions, we can manually select functions and define inputs and outputs with Call Library Function Node or try automatic dll wrapper creation with Import Shared Library option. Finally there are .NET libraries and they are quite magical. To import, all you have to do is to select a library file and a method using .NET Palette VIs.

Parameters tab in LabVIEW's Call Library Function Node

Call Library Function Node – call configuration

Conclusion

LabVIEW lets us overcome almost all of our engineering challenges involving programming. It offers good hardware support and wide enough choice of extensions. Everything just works without any environment configuration, which saves our time. It also gives us a convenient way of reusing external binary code.


Sławek

Leave a Reply