LabVIEW

from Wikipedia, the free encyclopedia
LabVIEW

Labview-logo.jpg
Basic data

developer National Instruments
Publishing year 1986
Current  version LabVIEW 2020
(May 2020)
operating system macOS , Windows , Linux
category programming language
License proprietary
German speaking Yes
LabVIEW

LabVIEW is a graphical programming system from National Instruments . The acronym stands for “ Lab oratory V irtual I nstrumentation E ngineering W orkbench”.

The first version appeared in 1986 for Macintosh computers. Today the development environment is also available for Windows and Linux . Similarly, Hewlett-Packard (now Agilent ) developed the visual programming language VEE . The main areas of application of LabVIEW are measurement , control and automation technology . The programming takes place with a graphic programming language, called "G" , according to the data flow model. The focus is on data acquisitionand processing. LabVIEW programs are known as Virtual Instruments, or simply VIs. They consist of two components: the front panel contains the user interface and the block diagram contains the graphic program code. This is not processed by an interpreter , but compiled . This makes the performance comparable to other high-level languages . LabVIEW uses the same libraries and data acquisition modules as LabWindows / CVI , the integrated development environment from National Instruments, and is therefore compatible with LabWindows / CVI. Function libraries are also available for many complex mathematical tasks. Similar to Matlab , LabVIEW also covers the areas of SP control and flexible test automation .

Programming method

LabVIEW code example

Function blocks are called Virtual Instruments (VIs) in LabVIEW (just like complete programs). This is because, in principle, each program can be used as a subprogram (SubVI) in another, or each SubVI can also be run independently. Due to the data flow concept, recursive calls were generally not possible up to version 8.6 . With additional effort, however, recursions could also be implemented. As of version 9.0, an invariant VI can contain itself as a subVI and thus call it recursively.

The programmer connects VIs with connecting lines (wires) and thus defines the flow of data. Each VI can have inputs and outputs. A VI begins executing when all of its input data is present; the results are only available at the outputs when the entire subroutine has been processed. In this way, the order in which the steps are processed is defined by data dependencies. There is no predefined sequence (e.g. "from right to left").

If a SubVI does not have any inputs, it is executed when the program starts. If it does not have any outputs, the result data is either discarded or “processed” in another way (e.g. writing to hard disk or network , output to peripheral devices ). In the same way, a SubVI without inputs can receive data from peripheral devices or generate it itself (e.g. using a random generator ).

SubVIs can be nested as deeply as you want. Many of LabVIEW's proprietary functions are themselves normal VIs that the programmer can edit (although this is usually not recommended). Ultimately, all VIs are based on a set of basic functions, called primitives, that cannot be opened as VIs.

Many VIs and functions in LabVIEW are polymorphic ; H. their functionality adapts to the type of data transferred. For example, the "Create Array" function can be used to create any field; H. Strings, integers or arrays and clusters. You can also create your own polymorphic VIs. Ultimately, this is a collection of several VIs with different data types at the inputs and outputs.

Data sources and data sinks can be linked to indicators and controls on the front panel. So z. B. a number input with a rotary knob and an output of a Boolean variable with a light emitting diode .

In the case of very large and extensive projects, as in other programming languages, it is important to use a well thought-out structure right from the start and to modularize the code. This is supported by the existing project manager (from V8.0). This makes it easier to manage a large number of VIs and external files. The versioning designed herewith easier. A major innovation (from V8.20) is the object-oriented programming. Classes and attributes and their methods can also be inherited .

LabVIEW Robotics 2009 includes tools for designing a robot system. Part of the software package is the Robotics Module, which includes a comprehensive robotics library with connection options to standard robotics sensors and actuators, basic algorithms for intelligent operation, and perception and motor control functions for robots and autonomous vehicles.

LabVIEW, TCP / IP, and XML web services

TCP / IP sockets transmit character strings in LAN and Internet. They are used, for example, for the HTTP protocol which displays websites in the web browser. LabVIEW makes use of TCP / IP sockets in the LAN for a variety of purposes:

  • Functions under Data Communication-> Protocols-> TCP .
  • Include web browser OLE on the front panel.
  • Reading out measured values, e.g. B. from DMM and NWA devices (see Measurement and Automation Explorer).
  • Remote control via remote panel.
  • XML web service.

On the one hand, the remote control via the remote panel is LabVIEW-specific. A user can connect to an open front panel via the web browser (IE preferred supported). The front panel itself then provides control. The intended benefit is access via a second PC. However, a window must be open on the source PC. NI also requires additional license fees for user numbers greater than one.

On the other hand, XML web services that you can create yourself are LabVIEW-specific. They are only included in the full version at a price of around € 3300. These web services do not require a GUI window on the host PC. An example howto shows how the user sends an HTTP GET request with two parameters to the service. The parameters are contained in the URL. The service runs a VI and responds with an XML file. The URL parameters are created in the service to be implemented as controls in the VI - all display elements of the VI appear with their values ​​in the XML file that is returned. A web service could therefore be used to control actuators and record measured values. With the web service you can implement your own graphic interfaces and actually use any client operating system. Batch scripts for long test runs would also be possible.

In order to provide a TCP service socket implicitly, there is the option of attaching it to an executable EXE via the project tree structure. If you start an application with Remote Panel, the socket is available at runtime.

The other way to deploy it is to use the NI web server and its document root directory, e.g. E.g. under C: \ Program Files (x86) \ National Instruments \ Shared \ NI WebServer \ www . The service appears in the service console under NI APPLICATION WEBSERVER and monitors port 8080. If the server is used on a host with the LabVIEW development environment, the service can be made available via the project tree structure. If you use the LabVIEW runtime environment on another host, you can provide the service using an installer that you create on the development system using the project tree structure.

advantages

  • An important consequence of graphical programming with LabVIEW is the ease with which parallel sequences can be programmed in LabVIEW. It is sufficient to place two subVIs next to each other without data dependency in order to process them simultaneously with multithreading . Similar to text-based programming systems, however, you have to pay attention to possible race conditions and, where necessary, block resources . For synchronization and communication between multiple threads are various options available (eg. As semaphores , alarms, queues ).
  • The LabVIEW front panel is a very convenient means of creating programs with a good graphical user interface. For all programming work in LabVIEW, the programmer does not have to enter any text, except for labels on design elements.
  • The graphical representation of the program flow increases the readability, at least for not too extensive projects. Scientists and technicians in particular usually understand the program logic very quickly and can use it to adapt software to their specific needs.
  • The extensive function libraries supplied depending on the license cover data analysis and mathematics to a large extent. But the control of additional (also external) (measuring) devices and system functions is well solved.
  • The supported communication protocols and connection technologies make it possible to control and use devices that are far away (e.g. in inaccessible places or in other countries). Among other things, TCP is used here.
  • From version 2009, LabVIEW offers the possibility of parallel programming of multicore processors and FPGAs and access to wireless technologies.

disadvantage

In addition to the advantages mentioned, graphic programming also has disadvantages compared to text-based programming:

  • LabVIEW programs can only be edited with the original LabVIEW development environment, to the functionality of which you are bound. However, functions from dynamic libraries or ActiveX objects can be used. The platform independence is due to obstacles in the design of user interfaces, so Windows hotkeys are not supported, and the behavior of accelerator keys does not exactly correspond to the behavior of the operating system (here: focus loss). The Unicode support is insufficient.
  • Executable LabVIEW programs can be created by the development system, but require the installation of a runtime environment on the target system (comparable to the installation of the .NET framework for .NET applications). When using certain additional modules, such as B. IMAQ Vision , a fee-based license is required for each target platform.
  • National Instruments tries to emulate the principles of modern object orientation with newer versions of LabVIEW, but so far this has only been unsatisfactory. In addition, programming against large existing class hierarchies such as the Microsoft .NET framework shows the limits in dealing with graphical access nodes - with text-based programming languages, for example C # , the same tasks can usually be programmed more quickly.
  • Small changes can result in costly restructuring, if space is created on the block diagram by moving, since the wires and symbols then often have to be rearranged in order to restore clarity. Structured programming can alleviate this problem (especially through consistent use of sub-VIs).
  • The simple introduction to LabVIEW programming leads to neglect the proper planning of the project.

Versions

Name / version Build number date
Start of the LabVIEW project April 1983
LabVIEW 1.0 (for Apple Macintosh) October 1986
LabVIEW 2.0 January 1990
LabVIEW 2.5 (First version for Sun & Microsoft Windows) August 1992
LabVIEW 3.0 (multiplatform) July 1993
LabVIEW 3.0.1 (First version for Windows NT) 1994
LabVIEW 3.1 1994
LabVIEW 3.1.1 (First version with "application builder") 1995
LabVIEW 4.0 April 1996
LabVIEW 4.1 1997
LabVIEW 5.0 February 1998
LabVIEW RT (Real Time) May 1999
LabVIEW 6.0 (6i) 6.0.0.4005 July 26, 2000
LabVIEW 6.1 6.1.0.4004 December 4, 2001
LabVIEW 7.0 (Express) 7.0.0.4000 April 2003
LabVIEW PDA module (first version) May 2003
LabVIEW FPGA module (first version) June 2003
LabVIEW 7.1 2004
LabVIEW Embedded module (First version) May 2005
LabVIEW 8.0 September 2005
LabVIEW 8.20 (Object Oriented Programming) August 2006
LabVIEW 8.2.1 8.2.1.4002 February 21, 2007
LabVIEW 8.5 8.5.0.4002 2007
LabVIEW 8.6 8.6.0.4001 July 24, 2008
LabVIEW 8.6.1 8.6.0.4001 12/10/2008
LabVIEW 2009 (32 and 64-bit) 9.0.0.4022 4.8.2009
LabVIEW 2009 SP2 9.0.1.4011 8.1.2010
LabVIEW 2010 10.0.0.4032 4.8.2010
LabVIEW 2010 f2 10.0.0.4033 September 16, 2010
LabVIEW 2010 SP1 10.0.1.4004 May 17, 2011
LabVIEW for LEGO MINDSTORMS (2010 SP1) August 2011
LabVIEW 2011 11.0.0.4029 June 22, 2011
LabVIEW 2011 SP1 11.0.1.4015 1.3.2012
LabVIEW 2012 12.0.0.4029 August 2012
LabVIEW 2012 SP1 12.0.1.4013 March 2013
LabVIEW 2013 13.0.0.4047 August 2013
LabVIEW 2013 SP1 13.0.1.4017 March 2014
LabVIEW 2014 14.0.0.4036 August 2014
LabVIEW 2014 SP1 March 2015
LabVIEW 2015 August 2015
LabVIEW 2015 SP1 March 2016
LabVIEW 2016 August 2016
LabVIEW 2017 May 2017
LabVIEW 2017 SP1 01/23/2018
LabVIEW 2018 18.0.0.4012 March 2018
LabVIEW 2018 SP1 03.12.2018
LabVIEW 2019 05/15/2019
LabVIEW 2019 SP1 October 28, 2019
LabVIEW 2020 05/15/2020

literature

  • Wolfgang Georgi; Ergun Metin: Introduction to LabVIEW , Fachbuchverlag Leipzig in Carl Hanser Verlag, 4th revised edition 2009, ISBN 978-3-446-41560-7
  • Bernward Mütterlein: Manual for programming with LabVIEW. With student version LabVIEW 8 (Hardcover) , 1st edition April 2007, ISBN 3-8274-1761-9
  • Kurt Reim: LabVIEW course: Basics, tasks, solutions , Vogel Buchverlag, 1st edition 2014, ISBN 978-3-8343-3294-3
  • Sebastian Trella; Thorsten Leimbach: Roberta - Programming with LabVIEW , Fraunhofer Verlag, 1st edition May 2014, 118 pages, ISBN 978-3-8396-0692-6

Web links

Individual evidence

  1. Recursion in LabVIEW (english)
  2. Using recursion with VIs (english)