LabView Academy Bevezetés
Adatok Dr. ing. Claudiu Pozna http://www.sze.hu/~pozna/ Horváth Ernő http://www.sze.hu/~herno/ Kajdocsi László Tanszéki honlap http://it.sze.hu 2
LabVIEW oktatás Magyarországon Budapest University of Technology and Economics (BME) Faculty of Electrical Engineering and Informatics Department of Electron Devices Faculty of Mechanical Engineering Department of Mechatronics, Optics and Mechanical Engineering Informatics Budapest Magyar Tudósok krt. 2. H-1117 Kecskemét College Faculty of Mechanical Engineering and Automation Kecskemét 6000 Isáki út 10 Széchenyi István University (SZE) Department of Computer Engineering Department of Automation Department of Automotive and Railway Engineering University of Debrecen Institute of Physics Győr H-9026, Egyetem tér 1. Debrecen 4010 Pf. 2, Bem tér 18/b University of Pécs Faculty of Sciences Pollack Mihály Faculty of Engineering Pécs H-7624 Ifjúság útja 6 University of Pannonia Faculty of Engineering Veszprém 8200 Egyetem Str. 10
A LabVIEW grafikus fejlesztői környezet első verzióját több mint 20 éve, 1986-ban adta ki a National Instruments, és azóta vezető platform az ipari alkalmazások között, a tesztelés, vezérlés, mérés és adatgyűjtés területén. Grafikus programnyelv Utasítások határozzák meg a program végrehajtását, adatfolyam-elv (dataflow) Natív többszálú párhuzamos programozás
Mire használhatjuk? + általános célú programnyelv
New User Experienced User Advanced User LabVIEW Core 1 LabVIEW Core 2 Certified LV Associate Developer Exam LabVIEW Core 3 LabVIEW Connectivity Object-Oriented Design and Programming in LabVIEW LabVIEW Performance Certified LabVIEW Developer Exam Managing Software Engineering in LabVIEW Advanced Architectures in LabVIEW Certified LabVIEW Architect Exam Other Courses LabVIEW Real-Time 1 LabVIEW Real-Time 2 LabVIEW Instrument Control LabVIEW Modular Instruments LabVIEW FPGA DAQ & Signal Conditioning
Gyakoribb adatformátumok Single-precision,floating-pointnumeric Double-precision, floating-point numeric Extended-precision, floating-point numeric Egyszeres pontosságú lebegőpontos (- + ) Dupla pontosságú lebegőpontos (- + ) 8-bit signed integernumeric Előjeles int (-128 +127) Kiterjesztett pontosságú lebegőpontos (- + ) 16-bit signed integer numeric Előjeles int (-32768 +32767) 32-bit signed integer numeric Előjeles int (-2147483648 +2147483647) 8-bit unsigned integernumeric Int (0 +255) 16-bit unsigned integer numeric Int (0 +65535) 32-bit unsigned integer numeric Int (0 +4294967295) Enumerated type Felsorolás típus Boolean Igaz vagy hamis érék String Array Cluster Path Waveform Digital waveform Szöveges változó, karakter tömbhöz hasonló Tömb (a szín a tömb típusának függvénye) Klaszter (lehet más színű is) Elérési út (fájlhoz vagy mappához) Analóg jel Digitális jel
Vezetékek (wire) Scalar 1D Array 2D Array Numeric Boolean String Dynamic
Virtual instrumentek (VI-ok) Front Panel Control = Bevitel Indicators = Kimenet Block Diagram A program kód Működési logika 9
Futtatás (eszköztár) A program futtatása ezzel az ikonnal történik futás közben átvált feketére De ha a nyíl összetöredezett képet mutat, akkor a program nem futtatható, mert hibás. Folyamatos futtatás, amely ciklikusan ismételgeti program végrehajtását. Stop gombbal leállíthatjuk a VI futását Pillanatmegállítás a program futása Csak a diagram ablakban találjuk meg, ha futtatás közben a lámpát bekapcsoljuk, akkor vizuálisan követhetjük a program futását a grafikus programban 10
Tools palette LabVIEW kiválasztja azt az eszközt, ami épp kell (Felső gomb) Front panelen és a block diagramon is Specifikus működéshez Elrejt/mutat Window»Show Tools Palette 11
Front Panel Controls Palette A szükséges controlok kiválasztásához 12
Block Diagram Functions Palette Functions Palette 13
Parts of a VI Front Panel Front Panel User interface for the VI You build the front panel with controls (inputs) and indicators (outputs).
Parts of a VI Block Diagram Block Diagram Contains the graphical source code Front panel objects appear as terminals on the block diagram.
Parts of a VI Icon/Connector Pane Icon Graphical representation of a VI Connector Pane Map of the inputs and outputs of a VI Icons and connector panes are necessary to use a VI as a subvi. A subvi is a VI that appears on the block diagram of another VI. A subvi is similar to a subroutine or function in a textbased programming language.
Front Panel
Controls and Indicators Controls Input devices Knobs, buttons, slides Supply data to the block diagram Indicators Output devices Graphs, LEDs Display data the block diagram acquires or generates
Front Panel Object Styles
Numeric Controls and Indicators The numeric data in a control or indicator can represent numbers of various types, such as integer or floating-point. Increment/Decrement buttons Numeric control Numeric indicator
Boolean Controls and Indicators The Boolean data type represents data that has only two options, such as True/False or On/Off. Use Boolean controls and indicators to enter and display Boolean (TRUE/FALSE) values. Boolean objects simulate switches, push buttons, and LEDs. Boolean control Boolean indicator
Strings The string data type is a sequence of ASCII characters. Use string controls to receive text from the user, such as a password or user name. Use string indicators to display text to the user.
Alapvetések Front Panel Control Terminals Block Diagram Indicator Terminals Wires Nodes
Adatfolyam-elvű programozás A block diagram végrehajtási sorrendje a vezetékek által meghatározott függés, NEM pedig balról-jobbra végrehajtás Egy csomópont (node) akkor hajtódik vége, ah minden szükséges bemenet rendelkezésre áll Egy csomópont (node) akkor szolgáltat adatot, amilyen gyorsan módjában áll 25
Teszt 1. Melyik függvény hajtódik végre előbb: összeadás, vagy kivonás? a) Összeadás b) Kivonás c) Nem tudjuk 2. Melyik függvény hajtódik végre előbb: szinusz, vagy osztás? a) Szinusz b) Osztás c) Nem tudjuk 26
Teszt 3. Melyik függvény hajtódik végre előbb: véletlen szám generátor, osztás, vagy összeadás? a) Véletlen szám generátor b) Osztás c) Összeadás d) Nem tudjuk 4. Melyik függvény hajtódik végre később: véletlen szám generátor, kivonás, vagy összeadás? a) Véletlen szám generátor b) Kivonás c) Összeadás d) Nem tudjuk 27
Express VI, VI és Funkció Express VI: interaktív VI-ok dialógusablakban konfigurálhatóak "Klasszikus" VI: a belekötött adatok alapján működik Funkciók: alapvető műveletek (pl szorzás) nincs front panel vagy block diagram 28
Block Diagram Nodes Icon Expandable Node Expanded Node Mindhárom ugyanaz, más nézetben Sárga: a "Klasszikus" VI Kék: Express VI 29
Probe Breakpoints Conditional Probe Debugging Techniques Right-click on wire and select probe and it shows data as it flows through the wire segment Right-click on wire and select Set Breakpoint; pause execution at the breakpoint. Combination of a breakpoint and a probe. Right-click on wire and select custom probe. 30
Debugging Techniques Step Into, Over, and Out buttons for Single Stepping Click on Step Into button to enable single stepping Once Single Stepping has begun, the button steps into nodes Click on Step Over button to enable single stepping or to step over nodes Click on Step Out button to step out of nodes 31
Common keyboard shortcuts Gyorsbillentyűk, stb. Windows Sun Linux MacOS <Ctrl-R> < -R> <M-R> <z-r> Run a VI <Ctrl-F> < -F> <M-F> <z-f> Find object <Ctrl-H> < -H> <M-H> <z-h> Activate Context Help window <Ctrl-B> < -B> <M-B> <z-b> Remove all broken wires <Ctrl-W> < -W> <M-W> <z-w> Close the active window <Ctrl-E> < -E> <M-E> <z-e> Toggle btwn Diagram/Panel Window Access Tools Palette with <shift>-right-click Increment/Decrement faster using <shift> key Tools»Options selection set preferences in LabVIEW VI Properties (File menu) 32
Köszönöm a figyelmet!