LabView Academy. 3. óra - cluster, for ciklus, while ciklus, DAQ alapok



Hasonló dokumentumok
Széchenyi István Egyetem

LabView Academy. Alapismeretek II.

16F628A megszakítás kezelése

LabView Academy. 4. óra párhuzamos programozás

LabView Academy. Bevezetés

Proxer 7 Manager szoftver felhasználói leírás

1. Gyakorlat: Telepítés: Windows Server 2008 R2 Enterprise, Core, Windows 7

SQL/PSM kurzorok rész

Csatlakozás a BME eduroam hálózatához Setting up the BUTE eduroam network

T Á J É K O Z T A T Ó. A 1108INT számú nyomtatvány a webcímen a Letöltések Nyomtatványkitöltő programok fülön érhető el.

Hogyan használja az OROS online pótalkatrész jegyzéket?

Angol Középfokú Nyelvvizsgázók Bibliája: Nyelvtani összefoglalás, 30 kidolgozott szóbeli tétel, esszé és minta levelek + rendhagyó igék jelentéssel

Using the CW-Net in a user defined IP network

LabVIEW Academy. 6. óra state machine

Correlation & Linear Regression in SPSS

Mérés és adatgyűjtés Laboratóriumi jegyzet

Cashback 2015 Deposit Promotion teljes szabályzat

Mechatronika II (BMEGEFOAMM2)

Cloud computing. Cloud computing. Dr. Bakonyi Péter.

IMAQ kamera kiválasztása. Rendszám. U:\Users\me\Desktop\VirtMűszer\Rendszámfelismerő\pattern_database

Create & validate a signature

EN United in diversity EN A8-0206/419. Amendment

Computer Architecture

INDEXSTRUKTÚRÁK III.

9. Gyakorlat: Network Load Balancing (NLB)

MAKING MODERN LIVING POSSIBLE. Danfoss Heating Solutions

Cloud computing Dr. Bakonyi Péter.

Out-Look. Display. Analog Bar. Testing Mode. Main Parameter. Battery Indicator. Second Parameter. Testing Frequency

USER MANUAL Guest user

10. Gyakorlat: Alkalmazások publikálása Remote Desktop Szervízen keresztül

4. Példa: Másodfokú egyenlet megoldása (program2_1.vi)

Basic Arrays. Contents. Chris Wild & Steven Zeil. May 28, Description 3

Utasítások. Üzembe helyezés

Teszt topológia E1/1 E1/0 SW1 E1/0 E1/0 SW3 SW2. Kuris Ferenc - [HUN] Cisco Blog -

Számítógépes Hálózatok GY 8.hét

THS710A, THS720A, THS730A & THS720P TekScope Reference

Adatbázis-kezelés ODBC driverrel

Személyes adatváltoztatási formanyomtatvány- Magyarország / Personal Data Change Form - Hungary

Széchenyi István Egyetem

English PATROL 24VDC SOROMPÓ HASZNÁLATI UTASÍTÁS

On The Number Of Slim Semimodular Lattices

Tavaszi Sporttábor / Spring Sports Camp május (péntek vasárnap) May 2016 (Friday Sunday)

(NGB_TA024_1) MÉRÉSI JEGYZŐKÖNYV

BKI13ATEX0030/1 EK-Típus Vizsgálati Tanúsítvány/ EC-Type Examination Certificate 1. kiegészítés / Amendment 1 MSZ EN :2014

1. Ismerkedés a Hyper-V-vel, virtuális gépek telepítése és konfigurálása

Társasjáték az Instant Tanulókártya csomagokhoz

Directors and Officers Liability Insurance Questionnaire Adatlap vezetõ tisztségviselõk és felügyelõbizottsági tagok felelõsségbiztosításához

Contact us Toll free (800) fax (800)

Léptetőmotorok. Előnyök: Hátrányok:

Smalltalk 2. Készítette: Szabó Éva

ios alkalmazásfejlesztés Koltai Róbert

Miskolci Egyetem Gazdaságtudományi Kar Üzleti Információgazdálkodási és Módszertani Intézet. Correlation & Linear. Petra Petrovics.

KIEGÉSZÍTŽ FELADATOK. Készlet Bud. Kap. Pápa Sopr. Veszp. Kecsk Pécs Szomb Igény

KN-CP50. MANUAL (p. 2) Digital compass. ANLEITUNG (s. 4) Digitaler Kompass. GEBRUIKSAANWIJZING (p. 10) Digitaal kompas

EBBEN A VIZSGARÉSZBEN A VIZSGAFELADAT ARÁNYA

INSTALLATION MANUAL For authorized service personnel only.

Alkalmazás-shop (Internet-kapcsolat szükséges)

Nevezze meg a jelölt csontot latinul! Name the bone marked! Nevezze meg a jelölt csont típusát! What is the type of the bone marked?

STUDENT LOGBOOK. 1 week general practice course for the 6 th year medical students SEMMELWEIS EGYETEM. Name of the student:

Construction of a cube given with its centre and a sideline

Személyes adatváltoztatási formanyomtatvány - Magyarország / Personal Data Change Form - Hungary

C#, OOP. Osztályok tervezése C#-ban

ELEKTRONIKAI ALAPISMERETEK ANGOL NYELVEN

Modbus kommunikáció légkondícionálókhoz

1.1. EGYETLEN KÉSZÜLÉK ÜZEMBE HELYEZÉSE KÉT KÉSZÜLÉK ÜZEMBE HELYEZÉSE BEKAPCSOLT/KÉSZENLÉTI ÁLLAPOT

Visual Basic elméleti leti alapok 2.

Számítógépes Hálózatok GY 9.hét

Cluster Analysis. Potyó László

Tulajdonságalapú tesztelés

ELEKTRONIKAI ALAPISMERETEK ANGOL NYELVEN

Statistical Inference

ROS Remote Operations Service

Virtuális Instrumentáció LabVIEW-el

MINO V2 ÁLLVÁNY CSERÉJE V4-RE

Első lépések. File/New. A mentés helyét érdemes módosítani! Pl. Dokumentumok. Fájlnév: pl. Proba

Miskolci Egyetem Gazdaságtudományi Kar Üzleti Információgazdálkodási és Módszertani Intézet. Hypothesis Testing. Petra Petrovics.

Correlation & Linear Regression in SPSS

ANGOL NYELV KÖZÉPSZINT SZÓBELI VIZSGA I. VIZSGÁZTATÓI PÉLDÁNY

Paysera VISA cards are secured with "3-D technology" which ensures safer payments with payment cards online.

Genome 373: Hidden Markov Models I. Doug Fowler

Új funkciók az RBP-ben október 1-től New functions in RBP from 1 October Tatár Balázs

Windows hálózati adminisztráció segédlet a gyakorlati órákhoz

(Asking for permission) (-hatok/-hetek?; Szabad ni? Lehet ni?) Az engedélykérés kifejezésére a következő segédigéket használhatjuk: vagy vagy vagy

Lexington Public Schools 146 Maple Street Lexington, Massachusetts 02420

ENROLLMENT FORM / BEIRATKOZÁSI ADATLAP

Lopocsi Istvánné MINTA DOLGOZATOK FELTÉTELES MONDATOK. (1 st, 2 nd, 3 rd CONDITIONAL) + ANSWER KEY PRESENT PERFECT + ANSWER KEY

ELEKTRONIKAI ALAPISMERETEK ANGOL NYELVEN

ELEKTRONIKAI ALAPISMERETEK ANGOL NYELVEN

FOSS4G-CEE Prágra, 2012 május. Márta Gergely Sándor Csaba

5. Példa: Olvasás szöveges fájlból (program3_1.vi)

SZERVER OLDALI JAVASCRIPT. 3. hét Javascript nyelvi elemek

discosnp demo - Peterlongo Pierre 1 DISCOSNP++: Live demo

8. Gyakorlat SQL. DDL (Data Definition Language) adatdefiníciós nyelv utasításai:

SAJTÓKÖZLEMÉNY Budapest július 13.

Mapping Sequencing Reads to a Reference Genome

ELEKTRONIKAI ALAPISMERETEK ANGOL NYELVEN

Szakmai továbbképzési nap akadémiai oktatóknak december 14. HISZK, Hódmezővásárhely / Webex

eseményvezérelt megoldások Vizuális programozás 5. előadás

Mechatronika II (BMEGEFOAMM2)

FÖLDRAJZ ANGOL NYELVEN

Átírás:

LabView Academy 3. óra - cluster, for ciklus, while ciklus, DAQ alapok

Adatok LabVIEW Academy - SZE http://labviewacademy.sze.hu/ Horváth Ernő http://www.sze.hu/~herno/ Tanszéki honlap http://it.sze.hu 2

Ellenőrző kérdések In the figure below, what will Result equal when this calculation is executed? a) 55 b) 70 c) 65 d) Indeterminate 3

Ellenőrző kérdések a) Auto-indexing enabled b) Auto-indexing disabled c) Nem eldönthető 4

Ellenőrző kérdések In the figure below, the output of Array Size is: a) a 1-D Array of {2, 3} b) a 1-D Array of {3, 2} c) 2 d) None of the above 5

Ellenőrző kérdések What is the result of the following Array subtraction? a) 1-D Array of {-25, 25, 50} b) 1-D Array of {-25, 25} c) 2-D Array of {{-25, -50, -50}, {50, 25, 25}} d) 1-D Array of {75, -50, 25} 6

Ellenőrző kérdések Which of the following statements is true regarding the execution of the following code? a) The loop will iterate 51 times. b) The loop will iterate 50 times. c) The loop will iterate 49 times. d) A For Loop that has a 50 wired to the count terminal will perform the same operation. 7

While Feltételtől függő számú ciklust végző utasítás Addig ismétli az általa bekeretezett blokk diagramot, ameddig a benne lévő feltétel igaz értékű. Ciklusszámláló: i (Iteration Terminal) 0-ról indul, az ismétlések számát (iterációt ) adja meg. Ciklusfeltétel (működésére feltétel adható meg) Feltétel kapcsolódási ponthoz egy logikai típusú adatot kell huzaloznunk.

Véges ciklust végző utasítás For Ciklusszámláló: i (Iteration Terminal) 0-tól indul, N-1-ig fut és arról tájékoztat, hogy hányadszor fut le a ciklus. Ciklusok száma: N (Count Terminal) A blokk diagram egy részét egy N-szer végrehajtja

Clusters Data structure that groups data together Data may be of different types Analogous to struct in C or a record in Pascal Elements must be either all controls or all indicators Thought of as wires bundled into a cable C nyelven hasonló adatszerkezet: struct Pont{ int x; int y; int z; double d; }; 10

Cluster Controls and Indicators 1. Select a Cluster shell from the Array & Cluster subpalette 2. Place objects inside the shell 11

Creating Cluster Constants 1. Select Cluster Constant shell from the Cluster subpalette 2. Place objects in the Cluster shell 12

Using Clusters to Pass Data to SubVIs Use clusters to pass several values to one terminal Overcomes 28-terminal limit Simplifies wiring 13

Bundle By Name Bundle Cluster Functions - Bundle Create new cluster Modify existing cluster Must have an existing cluster to use this function. 14

Cluster Functions - Unbundle Unbundle Unbundle By Name 15

Error Handling You cannot predict every problem a user can encounter. Without a mechanism to check for errors, you know only that the VI does not work properly. Error handling tells you why and where errors occur. Automatic error handling Manual error handling Error Handling Anticipation, detection, and resolution of warnings and errors

Error Cluster Use the error in and error out clusters in each VI you use or build to handle errors in the VI. The error clusters located on the Controls»Array & Cluster palette include the components of information shown 17

Error Cluster Details Status is a Boolean value that reports TRUE if an error occurred. Most VIs, functions, and structures that accept Boolean data also recognize this parameter. Code is a signed 32-bit integer that identifies the error numerically. A nonzero error code coupled with a status of FALSE signals a warning rather than a fatal error. Source is a string that identifies where the error occurred. 18

Hibaellenőrzés és hibakezelés Hibaellenőrzés: Van-e hiba, hol van hiba? Hibakezelés: Kezdjünk is vele valamit! Automatikus hibakezelés Manuális hibakezelés Egy hibavezetékre fűzzük fel a csomópontokat Időzítésre is jó (adatfolyam) 19

Error Handling with Clusters LabVIEW does not handle errors automatically. In LabVIEW, you can make these error handling decisions on the block diagram of the VI. Error handling in LabVIEW follows the dataflow model. Just as data flow through a VI, so can error information. Wire the error information from the beginning of the VI to the end. 20 Error Cluster

Simple Error Handler Use the Simple Error Handler to handle the error at the end of the execution flow. The Simple Error Handler is located on the Functions»All Functions»Time and Dialog palette. Wire the error cluster to the Error In (no error) input. 21

Using While Loops for Error Handling You can wire an error cluster to the conditional terminal of a While Loop to stop the iteration of the While Loop. Only the TRUE or FALSE value of the status parameter of the error cluster is passed to the terminal. When an error occurs, the While Loop stops. 22

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

24 Automatic Error Handling By default, LabVIEW automatically handles any known error when a VI runs by: Suspending execution. Highlighting the subvi or function where the error occurred. Displaying the Error list window. Automatic error handling is: Acceptable for quick prototypes. Not recommended for professional application development. Not included in LabVIEW-built executables.

25 Manual Error Handling You control when dialog boxes appear. Propagate errors by wiring the error out cluster to error in cluster of next node to execute. Terminate the error chain with a call to Simple Error Handler VI.

Disable Automatic Error Handling Options Dialog Box Block Diagram page Uncheck» Enable automatic error handling in new VIs» Enable automatic error handling dialogs Other suggested changes Front Panel page Set Control Style for New VIs to Silver style Block Diagram page Uncheck» Place front panel terminals as icons Configure Block Diagram Cleanup to customize your block diagram

Merge Errors Propagate errors along wires. Merge errors from different wire paths.

Merge Errors Function Merge Errors function returns the first error found. If no error is found, it returns the first warning. The Merge Errors function does not concatenate errors.

29 Error Clusters Use the error cluster controls and indicators to create error inputs and outputs in subvis. The error in and error out clusters include the following components of information: Status Code Source

Errors and Warnings Status = TRUE Status = FALSE Code = Non-zero Error Warning

Errors and Warnings Recommendations Report errors and warnings with the Simple Error Handler VI Modify Type of Dialog to detect warnings. Call the Simple Error Handler VI from the top-level VI. Avoid error dialogs in subvis.

Melyik esetben While és mikor For ciklus? For Ha előre tudjuk, hogy egy feladatot pl. 50-szer kell elvégeznünk. Általában a tömb műveletek Lefuthat 0-szor is Miért? Mert a feltétel (ami az N- be van kötve) futás előtt kiértékelődik, ha az 0, akkor gyakorlatilag le se fut. While Érdemes használni, ha egy felhasználói beavatkozásig vagy egy bizonyos érték eléréséig várunk. Legalább egyszer lefut Miért? Mert a feltétel kiértékelődése az első futáskor történik meg; aztán persze minden további esetben, ha van. 32

Shift regiszter Az előző iterációból érkező adatot használhatjuk fel segítségével Ha 2szer fut le: Result = (( Initial * 3 ) * 3 ) 33

Milyen eredmény jelenik meg az indikátoron? A ciklus 4x fut le Futása: i = 0 Indikátor = 2 i = 1 Indikátor = 4 i = 2 Indikátor = 8 i = 3 Indikátor = 16 Shift regiszter 34

35 Debugging Techniques What to look for if a VI produces unexpected data or behavior: Are there any unwired or hidden subvis? Is the default data correct? Does the VI pass undefined data? Are numeric representations correct? Are node executed in the correct order?

36 Execution Highlighting Use execution highlighting to watch the data flow through the block diagram. If the VI runs more slowly than expected, confirm that you turned off execution highlighting in subvis.

37 Single-Stepping Single-step through the VI to view each action of the VI on the block diagram. Suspend the execution of a subvi to edit values of controls and indicators, to control the number of times it runs, or to go back to the beginning of the execution of the subvi. Open subvi and select Operate»Suspend When Called from the shortcut menu.

Probes Use the Probe tool to observe intermediate data values and check the error output of VIs and functions, especially those performing I/O. Specify to retain the values in the wires so that you can probe wires for data after execution. 38

39 Breakpoints When you reach a breakpoint during execution, the VI pauses and the Pause button appears red. You can take the following actions at a breakpoint: Single-step through execution using the single-stepping buttons. Probe wires to check intermediate values. Change values of front panel controls. Click the Pause button to continue running to the next breakpoint or until the VI finishes running.

Melyik esetben While és mikor For ciklus? For Ha előre tudjuk, hogy egy feladatot pl. 50-szer kell elvégeznünk. Általában a tömb műveletek Lefuthat 0-szor is Miért? Mert a feltétel (ami az N- be van kötve) futás előtt kiértékelődik, ha az 0, akkor gyakorlatilag le se fut. While Érdemes használni, ha egy felhasználói beavatkozásig vagy egy bizonyos érték eléréséig várunk. Legalább egyszer lefut Miért? Mert a feltétel kiértékelődése az első futáskor történik meg; aztán persze minden további esetben, ha van. 40

Shift regiszter Az előző iterációból érkező adatot használhatjuk fel segítségével Ha 2szer fut le: Result = (( Initial * 3 ) * 3 ) 41

Milyen eredmény jelenik meg az indikátoron? A ciklus 4x fut le Futása: i = 0 Indikátor = 2 i = 1 Indikátor = 4 i = 2 Indikátor = 8 i = 3 Indikátor = 16 Shift regiszter 42

Elektrotechnikai tudnivalók Light-emitting diode (LED) félvezető anyagból készült fényforrás. 43

Elektrotechnikai tudnivalók A fotóellenállás (photoresistor) egy berendezés, amely a fényhullámokra elektromos választ ad. 44

Led: GND / AO0 Fotóellenállás: GND / +5V / AI0 45

pelda_cluster01.vi Olvassunk be analóg jeleket lebegőpontos számként adatgyűjtő kártyáról. A felhasználó adhasson meg egész értékeket, majd ezeket egy klaszterré (cluster) összefoglalva jelezzük ki diagramon (chart) és számértékként. 46

pelda_cluster01.vi 47

pelda_cluster01.vi 48

pelda_cluster02.vi Fejlesszük tovább az előző példa hibakezelését. Amennyiben a mérőkártyáról hiba érkezik (pl. USB kábel kihúzásából eredően) a program álljon le, és indikátoron jelezze a hiba kódját, forrását. 49

Köszönöm a figyelmet!