Introduction to Università degli Studi di Catania DIEEI
Outline Definitions about Labview Main features and advantages Environment G‐Language principal components Labview in a measurement scenario Università degli Studi di Catania DIEEI
Introduction to NI LabVIEW What is LabVIEW ? LabVIEW alias LABoratory Virtual Instruments Engineering Workbench is a programming environment in which you create programs using a graphical notation (connecting functional nodes via wires through which data flows) It is much more than a programming language Programs that take weeks or months to write using conventional programming languages can be completed in hours using LabVIEW because it is specifically designed to take measurements, analyze data, and
Introduction to NI LabVIEW What is LabVIEW ? – Real vs Virtual Instruments Real Instrument (Agilent digital scope) “Pre‐defined” User Interface • Buttons (boolean input) • Knobs (numeric input) • Display (graphical output) • … • … Behaviour & Features strictly related on hardware architecture • • • • • ADC (resolution/sampling rate) Microprocessor Memory A mid‐range Digital Scope can (at least): Input/Output • Display Waveform (tipically up to 4) … • Perform basic measurement (time/amplitude/frequency
Introduction to NI LabVIEW What is LabVIEW ? – Real vs Virtual Instruments Virtual Instrument “Fully customizable” User Interface • Plenty of Controls and Indicators • Custom appeareance and behaviour • Advanced control on user interaction • … • … Behaviour is software defined thus fully programmable! (Block Diagram) Features loosely related on hardware architecture easily upgradable + Mid‐range Laptop running LabVIEW Università degli Studi di Catania USB Data Acquisition (NI‐USB 6251) PCMCIA Data
Main features and advantages Università degli Studi di Catania DIEEI
Introduction to NI LabVIEW Faster Programming Università degli Studi di Catania DIEEI LabVIEW main features 1/6
Introduction to NI LabVIEW LabVIEW main features 2/6 Hardware Integration DAQ GPIB Università degli Studi di Catania DIEEI Ethernet controller
Introduction to NI LabVIEW LabVIEW main features 3/6 Advanced Analysis Examples: Spectral analysis (FFT, PSD, harmonic distortion…) Stochastic analysis (mean, std, covariance, histogram…) Signal operations (convolution, deconvolution, cross‐correlation…) Data filtering and numeric signal processing (Digital Signal Processing) Signal conditioning Data fitting and interpolation Università degli Studi di Catania DIEEI
Introduction to NI LabVIEW LabVIEW main features 4/6 Multiple Targets & OSs Portable devices Microcontrollers Multicore interface Università degli Studi di Catania DIEEI FPGA
Introduction to NI LabVIEW LabVIEW main features 5/6 Multiple Programming Approaches Examples: Interfacing with libraries written in several programming languages (C/C++, Java, Fortran, Visual Basic and so on) Matlab .
Introduction to NI LabVIEW User Interfaces Università degli Studi di Catania DIEEI LabVIEW main features 6/6
Introduction to NI LabVIEW LabVIEW development system architecture Embedded Design Control Design & Simulation Real‐Time module Real‐Time Execution Trace Toolkit FPGA module Microprocessor SDK Statechart module Mobile module DSP module Embedded module for ADI Blackfin Processors Embedded Module for ARM Microcontrollers Control Design and Simulation module Fuzzy Logic Toolkit Simulation Interface module System Identification toolkit Software Development & Deployment Applic
Environment Università degli Studi di Catania DIEEI
Introduction to NI LabVIEW Introduction to Virtual Instruments: Front Panel LabVIEW programs are called virtual instruments (VI) because their appearance and operation imitate physical instruments, such as oscilloscopes and multimeters. Every VI uses functions that manipulate input from the user interface or other sources and display that infromation or move to other file or other computers.
Introduction to NI LabVIEW Introduction to Virtual Instruments: Block Diagram LabVIEW programs are called virtual instruments (VI) because their appearance and operation imitate physical instruments, such as oscilloscopes and multimeters. Every VI uses functions that manipulate input from the user interface or other sources and display that information or move to other file or other computers.
Introduction to NI LabVIEW Introduction to Virtual Instruments: Icon & Connection Panel LabVIEW programs are called virtual instruments (VI) because their appearance and operation imitate physical instruments, such as oscilloscopes and multimeters. Every VI uses functions that manipulate input from the user interface or other sources and display that infromation or move to other file or other computers.
G‐Language principal components Università degli Studi di Catania DIEEI
Introduction to NI LabVIEW LabVIEW G‐Language: Function & Interface double myFunction (double* a, int size) { double result = 0; Black‐box approach; we only need the prototype int tempSize = size; double* while (tempSize-->0) myFunction double result += *a++; int return result/size; INPUTS } 1D array of double OUTPUTS double scalar int scalar The connection pane of LabVIEW nodes plays the same role of the function prototype in a traditional text‐based programming language Università degli Studi di
Introduction to NI LabVIEW LabVIEW G‐Language: Data Types In LabVIEW there are 32 different data types. The color and symbol of each terminal indicate the data type of the corresponding control or indicator. In the following table the 9 most common are reported. Control Indicator Description Float. Double‐precision, floating‐point numeric Integer. 32‐bit signed integer numeric Boolean. Stores Boolean (TRUE/FALSE) values. String.
Introduction to NI LabVIEW LabVIEW G‐Language: Nodes Nodes are objects on the block diagram that have inputs and/or outputs and perform operations when a VI runs. They are analogous to statements, operators, functions, and subroutines in text‐ based programming languages. LabVIEW includes the following types of nodes: • Functions—Built‐in execution elements, comparable to an operator, function, or statement. • SubVIs—VIs used on the block diagram of another VI, comparable to subroutines.
Introduction to NI LabVIEW LabVIEW G‐Language: Express VIs An Express VI is a VI whose settings you can configure interactively through a dialog box. Express VIs appear on the block diagram as expandable nodes with icons surrounded by a blue field. You can configure an Express VI by setting options in the configuration dialog box that appears when you place the Express VI on the block diagram. The primary benefit of Express VIs is their interactive configurability.
Introduction to NI LabVIEW LabVIEW G‐Language: Controlling Program Execution Structures are graphical representations of the loops and case statements of text‐based programming languages. Use structures on the block diagram to repeat blocks of code and to execute code conditionally or in a specific order. Like other nodes, structures have terminals that connect them to other block diagram nodes, execute automatically when input data is available, and supply data to output wires when execution completes.
Introduction to NI LabVIEW LabVIEW G‐Language: Formula & Expression Nodes The Formula Node is a resizable box that you use to enter algebraic formulas directly into the block diagram. You will find this feature extremely useful when you have a long formula to solve. For example, consider the fairly simple equation, y = x2 + x + 1.
Introduction to NI LabVIEW LabVIEW G‐Language: Array array A LabVIEW is a collection of data elements that are all the same type, just like in traditional programming languages. An array data element can have any type except another array, a chart, or a graph. Array elements are accessed by their indices; each element's index is in the range 0 to N‐1, where N is the total number of elements in the array.
Introduction to NI LabVIEW LabVIEW G‐Language: Clusters Like an array, a cluster is a data structure that groups data. However, unlike an array, a cluster can group data of different types (i.e., numeric, Boolean, etc.); it is analogous to a struct in C or the data members of a class in C++ or Java.
Labview in a measurement scenario Università degli Studi di Catania DIEEI
Introduction to NI LabVIEW The typical measurement scenario • Sensors and transducers detect physical phenomena. • Signal conditioning components condition physical phenomena so that the measurement device can receive data. • The computer receives the data through the measurement device. • Software controls the measurement system, telling the measurement device when and from which channels to acquire or generate data.
Introduction to NI LabVIEW DAQ: signals & information Strictly speaking, all signals are analog time‐varying signals. However, to discuss signal measurement methods, you should classify a given signal as one of five signal types. A signal is classified as analog or digital by the way it conveys information. • A digital (or binary) signal has only two possible discrete levels—high level (on) or low level (off).
Introduction to NI LabVIEW DAQ: signals & information Strictly speaking, all signals are analog time‐varying signals. However, to discuss signal measurement methods, you should classify a given signal as one of five signal types.
Introduction to NI LabVIEW DAQ: Hardware Bus Considerations PCI & PCIexpress (best throughput and latency performances) USB (portability, plug&play) WI/FI – Ethernet (wireless or wired remote measurement) PXI – PXIexpress (modular, high‐bandwidth open‐PC based platform) Università degli Studi di Catania DIEEI
Introduction to NI LabVIEW 16‐ or 18‐bit, up to 1.25 MS/s, up to 80 analog inputs Up to 4 analog outputs at 16 bits, 2.
Introduction to NI LabVIEW LabVIEW G‐Language: DAQ concepts Virtual channels define real‐world measurements consisting of one or more DAQ channels (terminals on your DAQ device) along with other channel‐specific information: range, terminal configuration, and custom scaling that is used to format the data. An NI‐DAQmx Task is a collection of one or more virtual channels along with timing, triggering, and other properties. Conceptually, a task represents a measurement or generation you want to perform.
Introduction to NI LabVIEW DAQ: Grounding Voltage is not absolute; it always requires a reference to be meaningful. Voltage is always the measure of a potential difference between two bodies. One of these bodies is usually picked to be the reference and is assigned "0 V." So to talk about a 3.47 V signal really means nothing unless we know with respect to what reference. Earth ground refers to the potential of the earth below your feet.
Introduction to NI LabVIEW DAQ: Voltage Sources The DAQ devices in your computer are also expecting to measure voltage with respect to some reference. What reference should the DAQ device use? You have your choice, which will depend on the kind of signal source you're connecting. Signals can be classified into two broad categories, as follows: A grounded source is one in which the voltage signals are referenced to a system ground, such as earth or building ground.
Introduction to NI LabVIEW DAQ: Differential terminal configuration In a differential measurement system, neither input is connected to a fixed reference such as earth or building ground. Most DAQ devices with instrumentation amplifier can be configured as differential measurement systems. The figure above depicts the eight‐channel differential measurement system used in the E‐series DAQ devices.
Introduction to NI LabVIEW A referenced single‐ended (RSE) measurement system, also called a grounded measurement system, is similar to a grounded signal source, in that the measurement is made with respect to earth ground. The figure above depicts a 16‐channel RSE measurement system.
Introduction to NI LabVIEW DAQ: Terminal Configuration The general guideline for deciding which measurement system to pick is to measure grounded signal sources with a differential or NRSE system, and floating sources with an RSE system. The hazard of using an RSE system with a grounded signal source is the introduction of ground loops, a possible source of measurement error.
Introduction to NI LabVIEW DAQ: Sampling Real‐world signals are continuous things. To represent these signals in your computer, the DAQ device has to check the level of the signal every so often and assign that level a discrete number that the computer will accept; this is called an analog‐to‐digital conversion. The computer then sort of "connects the dots" and, hopefully, gives you something that looks similar to the real‐world signal (that's why we say it represents the signal).
Introduction to NI LabVIEW DAQ: ADC & DAC Aliasing has the effect of introducing frequencies into your data that didn't exist in the real‐world signal (and removing some that did), thereby severely distorting your signal. Once you have aliased data, you can never go back: There is no way to remove the "aliases." That's why it's so important to sample at a high‐enough rate.
Introduction to NI LabVIEW DAQ: NI HW comparison Example Input analogico Numero di canali Frequenza di campionamento Risoluzione Campionamento simultaneo Intervallo massimo di tensione Intervallo di accuratezza Intervallo minimo di tensione Intervallo di accuratezza Output analogico Numero di canali Velocità di aggiornamento Risoluzione Intervallo massimo di tensione Intervallo di accuratezza Intervallo minimo di tensione Intervallo di accuratezza I/O digitale Numero di canali Temporizzazione Livelli di