Az előadás letöltése folymat van. Kérjük, várjon

Az előadás letöltése folymat van. Kérjük, várjon

LabView Academy Alapok2, Tömbök.

Hasonló előadás


Az előadások a következő témára: "LabView Academy Alapok2, Tömbök."— Előadás másolata:

1 LabView Academy Alapok2, Tömbök

2 Grafikus programnyelv
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

3 Mire használhatjuk? + általános célú programnyelv

4 Virtual instrumentek (VI-ok)
Front Panel Control = Bevitel Indicators = Kimenet Block Diagram A program „kód” Működési logika

5 Correcting Broken VIs One of the most common debugging features used in LabVIEW is the compiler which is always on. While you are developing a program, the compiler continuously checks for errors and provides semantic and syntactic feedback on the application. When the Run button is not broken, the VI is compiled and can be executed. If an error exists, you cannot run the program. You see a broken Run button in the toolbar. The VI is not executable. You must resolve any errors noted in the Errors List window before you can run the VI. Instructors: This is a good opportunity to remind students that LabVIEW is a compiled language. Broken Run arrow  VI cannot be compiled  VI cannot be executed

6 Common Causes of Broken VIs
Broken wires exist on the block diagram. You wired a Boolean control to a String indicator. You wired a numeric control to a numeric control. A required block diagram terminal is unwired. A subVI is broken.

7 Egyszerű feladat

8 2-3-as feladat Alapismeretek, szerkesztő eszközök használata Gyakorlat

9 Gyakoribb adatformátumok
Single-precision,floating-pointnumeric Egyszeres pontosságú lebegőpontos (-∞ +∞) Double-precision, floating-point numeric Dupla pontosságú lebegőpontos (-∞ +∞) Extended-precision, floating-point numeric Kiterjesztett pontosságú lebegőpontos (-∞ +∞) 8-bit signed integernumeric Előjeles int ( ) 16-bit signed integer numeric Előjeles int ( ) 32-bit signed integer numeric Előjeles int ( ) 8-bit unsigned integernumeric Int (0 +255) 16-bit unsigned integer numeric Int ( ) 32-bit unsigned integer numeric Int ( ) Enumerated type Felsorolás típus Boolean Igaz vagy hamis érék String Szöveges változó, karakter tömbhöz hasonló Array Tömb (a szín a tömb típusának függvénye) Cluster Klaszter (lehet más színű is) Path Elérési út (fájlhoz vagy mappához) Waveform Analóg jel Digital waveform Digitális jel

10 Gyakoribb adatformátumok

11 Vezetékek (wire) Scalar 1D Array 2D Array Numeric Boolean String
Dynamic

12 Tools / Options / Block diagram / Place front panel terminals as icon
Ikon nézet Tools / Options / Block diagram / Place front panel terminals as icon

13 Műveletek tömbökkel 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 index
• Mik a tömbök? Azonos típusú változók rendezett gyűjteménye • Lehetnek 1 vagy több dimenziósak • Az elemek azonosítására az index szolgál. Az index 0-val kezdődik index 10 elemű tömb 1.2 3.2 8.2 8.0 4.8 5.1 6.0 1.0 2.5 1.7 2 dimenziós tömb 1 2 3 4

14 Tömb létrehozása kontrolokkal, indikátorokkal
1. Válasszuk ki a Control palettáról Az Array, Cluster, Matrix menüből az Array típust

15 Tömb létrehozása kontrolokkal, indikátorokkal
2. Húzzuk bele az általunk választott kontrolt/indikátort

16 Tömb létrehozása kontrolokkal, indikátorokkal
3. Amennyiben szükséges, adjunk hozzá dimenziót

17 Tömb létrehozása konstansként
Válaszuk ki Array Constant >> Array (Block diagram) 2. Húzzuk a kívánt változót bele, majd módosítsuk

18 Tömb létrehozása auto-indexeléssel
Auto-Indexing Enabled Ciklusokkal is létrehozhatunk tömböket A For ciklus alapértékként auto-indexel, de ez ki is lehet kapcsolni While ciklus alapértelmezésben csak az utolsó éréket adja Jobb gombbal a ciklus kimeneti pontján kapcsolhatjuk ki/be az auto-indexelést Wire becomes thicker 1D Array Auto-Indexing Disabled Wire remains the same size

19 2D tömb létrehozása A belső ciklus a sorokat, míg
1D Array 2D Array A belső ciklus a sorokat, míg A külső ciklus az oszlopokat hozza létre

20 Initialize Array (Tömb inicializálás)
Gyakori tömb funkciók Array Size (Tömb méret) Initialize Array (Tömb inicializálás)

21 Gyakori tömb funkciók Array Subset (Tömb részterület)

22 Index Array funkció Egy elem Egy sor

23 Dialog One button (csak a kattintás ténye) Two button (választás)

24 Új Funkciók áttekintése
Today we’ll be taking a look at the new features in the latest version of LabVIEW.

25 Accelerates Your Success
System Design Software Project Explorer Manage and organize all system resources, including I/O and deployment targets Hardware Connectivity Bring real-world signals into LabVIEW from any I/O on any instrument Deployment Targets Deploy LabVIEW code to the leading desktop, real-time, and FPGA hardware targets Parallel Programming Create independent loops that automatically execute in parallel Instant Compilation See the state of your application at all times, instantly Block Diagram Define and customize the behavior of your system using graphical programming Front Panel Create event-driven user interfaces to control systems and display measurements Analysis Libraries Use high-performance analysis libraries designed for engineering and science Main Message: For over 26 years, LabVIEW has made engineers more productive by ensuring that they can take full advantage of hardware products like the ones we just saw, and that they are able to use them with all of the analysis and UI capabilities necessary for any measurement or control system. LabVIEW increases productivity by abstracting low-level complexity and integrating all of the technology engineers and scientists need into a single, unified development environment, unlike any other text-based alternative. Transition: Each new version of LabVIEW is designed with features to further enhance and accelerate productivity. Models of Computation Combine and reuse .m files, C code, and HDL with graphical code Timing Define explicit execution order and timing with sequential data flow Accelerates Your Success By abstracting low-level complexity and integrating all of the tools you need to build any measurement or control system

26 LabVIEW 2012 kezdőképernyő
Pin Common Projects Start from a Template Find Learning Resources Find LabVIEW Add-Ons Main Message: This is a summary of some of the major enhancements to the new getting started window. The welcome dialog, which displays the first time you launch the product can be brought back up by clicking ‘Welcome to LabVIEW’ in the lower right-hand corner. You can launch the LabVIEW Tools Network, powered by JKI’s VI Package Manager, by clicking ‘Find LabVIEW Add-Ons’ in the lower left corner. Instead of just displaying the last two opened projects (as previous versions did), 2012 displays a list and allows you to pin the most commonly used projects. There is an RSS feed at the bottom for new and product updates. Finally, clicking ‘Create Project’ launches the new dialog which features new templates and sample projects. RSS News and Announcements

27 Templatek és példa projektek
Ajánlott kezdőpont különböző LabVIEW alkalmazások fejlesztéséhez Pontosan mutatja hol kell saját kódot hozzáadni „Best practices” kódoláshoz, dokumentáláshoz, kód szervezéshez Saját templatek is definiálhatóak Presenter Note: To avoid confusion, try to avoid the use of the term ‘examples,’ as they are not related to the content of the Example Finder. Main Message: LabVIEW 2012 introduces templates and sample projects, which provide recommended starting points designed to ensure the quality and scalability of a system. All of the templates and sample projects are open-source and include extensive documentation designed to clearly indicate how the code works and the best practices for adding or modifying functionality. In addition to demonstrating recommended architectures, these projects also illustrate best practices for documenting and organizing code. What is the Difference Between a Template and a Sample Project? Template Commonly used project, code, documentation, and folder structure. May demonstrate a design pattern. Sample Project A working application that is a starting point for customization. Typically based on templates. Examples (in Example Finder) Conceptual illustration demonstrating how to use a low-level API or technology within LabVIEW You can create a new LabVIEW project from an existing template or sample project by selecting 'Create Project' from the Getting Started window. The list of available options depends on the software modules and drivers that you have installed. This document lists the templates and sample projects that are provided and supported by National Instruments. Transition: Lets take a look at a few of the sample projects.

28 Példa: Finite Measurement Sample Project State Diagram
Configure Copy Graph Initialize Stop Acquire Analyze Export Data Wait for Event Wait for Event Save Data Load Data Acquire Configure Analyze Clear Data Main Message: ‘Finite Measurement’ is the simplest sample project, but it still provides a complete, ready-to-run LabVIEW application for basic acquisition and analysis. This sample project illustrates the use of the state machine template for a basic measurement system that executes operations sequentially and in a single loop. The version of this sample project that’s installed with DAQmx (version or later) has functionality built-in to acquire data, perform some basic statistical analysis, display and export the data. This diagram illustrates the state logic of this single process application, which consists of multiple Vis and type definitions. As we see if we zoom in on the actual code, it’s complete with documentation and information that explains where and how to modify the code. Transition: Next, consider a slightly more complex example: Update UI

29 Idea Exchange Features
Labelek különböző vezérlőszerkezeteknek Main Message: Well-documented block diagrams generally include comments indicating what operations or processes the structure performs. Previously, these would be made using floating labels, which would not move or resize with the structure itself adds a new type of label known as integrated structure labels which are associated with their structure and will always move and resize as you add to your code, ensuring that you can always have clear, well-organized block diagrams.

30 Idea Exchange Features
Pop-up menü több kijelölt objektumnak Main Message: There are several operations that are often performed for a large collection of items on the block diagram, including the creation of constants, creating controls and indicators, creating references to front panel controls, toggling labels on and off, and changing icons to terminals (just to name a few). Previously, this would’ve required repeating the steps necessary to perform this operation for every individual item. Take for example the process of creating references for a large number of front panel controls: you would previously have to click on every single one and navigate to ‘create > reference,’ which quickly adds up for a complex user interface. In 2012, the right-click menu for a collection of selected items displays operations that are common to all the selected items, so you can select all of the front panel controls and select ‘create references’ for all these items at once, which can save a tremendous amount of time across the development of a system.

31 Idea Exchange Features
Feltételes Loop Tunnel Leegyszerűsített verzió Hagyományos Main Message: Loops often build an array of data as an output. Tunnels can be used to automatically build arrays after every iteration, but some processes require that this operation be conditional. Previously, this required using a case structure to conditionally append data to an array, which is a simple operation, but needlessly clutters and complicates a block diagram, as well as consuming additional development time. LabVIEW 2012 allows the tunnels to have an additional conditional input, which can be used to determine whether or not an item should be appended to the array, thereby making the code significantly simpler and easier to read, as well as saves the time required to develop the code.

32 Idea Exchange Features
Külön alapérdemezett hely a kontroloknak, indikátoroknak Egyszerűbb és átláthatóbb kód Main Message: Creating controls, indicators and terminals, as well as cleaning up a block diagram or creating a subVI, always places label in the same default location. LabVIEW 2012 makes it possible to specify the default location for these operations, and allows it to be unique to controls terminals and constants, indicators and all other items.

33 Idea Exchange Features
Context Help for Coercion Dots Main Message: Hovering over terminals and outputs of Vis to provide information about the data-type, which is especially helpful when trying to eliminate coercion dots. Részletesebb és gyorsabb átláthatóság típuskényszerítésnél

34 Idea Exchange Features
Hosszú fájlnevek megjelenítése Main Message: The way paths are displayed in controls and indicators can now be specified, as requested by users

35 LabVIEW GPU Analysis Toolkit
Support for NVIDIA® CUDA™ GPUs Communicate with NVIDIA® CUDA™ GPUs from LabVIEW applications Quickly prototype GPU algorithms using cuBLAS and cuFFT functions wrapped in LabVIEW Access documentation on calling custom GPU code from LabVIEW Main Message: This toolkit enables customers to interact with NVIDIA CUDA graphics processing units (GPUs) from LabVIEW, which are optimized for processing large amounts of parallel floating point data. The first important thing to understand is that graphics processing units feature very different architectures than CPUs. Instead of one to several processing cores, GPUs commonly contain hundreds to thousands of specialized cores. While GPUs evolved to support graphics operations, they are now increasingly being used to augment general-purpose computing. With this in mind, note that the LabVIEW GPU Analysis Toolkit does not simply compile LabVIEW applications for GPUs. Instead, the toolkit enables calling compiled GPU code from LabVIEW – you can think of this as similar to the Call Library Function Node. A set of common linear algebra (CUBLAS) and signal processing (CUFFT) functions are pre-wrapped as LabVIEW VIs as part of the toolkit. In addition, advanced users can call their custom GPU code from LabVIEW using instructions provided with the toolkit. Use Case Customers will use a GPU for similar reasons as MASM, but the GPU will perform best when the problem is very data or task-parallel. Each core on the GPU is less flexible and lower performance than an equivalent CPU core, however the GPU features orders of magnitude more processing cores. Though customers can use GPUs in a variety of applications, real-time high performance computing applications (where customers require IO and closing the loop) are a sweet spot where we can combine our SW, IO, FPGAs, CPUs, and GPUs to offer a compelling solutionfor solving these challenges. Select GPU devices and manage resources using CUDA Runtime and Driver APIs

36 Feladat Próbáljuk ki a LabView 2012 új funkcióit egy egyszerű feladattal Gyakorlat

37 Hasznos

38 Köszönöm a figyelmet!


Letölteni ppt "LabView Academy Alapok2, Tömbök."

Hasonló előadás


Google Hirdetések