La descarga está en progreso. Por favor, espere

La descarga está en progreso. Por favor, espere

Instrumentos Virtuales (VIs)

Presentaciones similares


Presentación del tema: "Instrumentos Virtuales (VIs)"— Transcripción de la presentación:

1 Instrumentos Virtuales (VIs)
Panel Principal o frontal Controles = Inputs Indicadores = Outputs Diagrama de bloques “Programa” del Panel frontal Componentes “alambrados” LabVIEW programs are called virtual instruments (VIs). Stress that controls equal inputs, indicators equal outputs. Each VI contains three main parts: Front Panel – How the user interacts with the VI. Block Diagram – The code that controls the program. Icon/Connector – Means of connecting a VI to other VIs. Do not spend too much time on this slide. Explain that we will go into more detail as we go through the slides.

2 Icono/Conector Un icono representa a un VI en otro diagrama de bloques
Un conector pasa y recibe datos de un “subVI” a través de terminales icono conector terminales Icon: Means of turning a VI into an object that can be used in other programs (compare it to a subroutine). Graphically represents the VI in the block diagram of other VIs. Connector: Terminals define where to wire inputs and outputs. Analogous to parameters of a subroutine. Terminals correspond to controls and indicators on the front panel. Hidden under the icon unless the user chooses to view it.

3 Ejemplo: VI - Temperatura
SubVI LabVIEW is hierarchical in nature: You can have many layers of VIs. Very modular, easy to debug and change. This is why LabVIEW is so powerful. Explain the example in the slide: Show the relationship between front panel objects and their corresponding terminals on the block diagram. # of Readings: control for entering number of measurements to be read. Loop Delay: amount of time between measurements. Temperature Signal: indicator that displays the temperatures that have been read.

4 Archivos de LabVIEW Menú Inicio: Archivos de Programas
National Instruments LabVIEW 6.1 (7.0) For all platforms, the LabVIEW system consists of the LabVIEW application and associated files. Describe these files and directories: vi.lib, Examples, Help, user.lib, instr.lib, and BASICS.LLB. Windows - LabVIEW Directory (shown above) LabVIEW: Starts the LabVIEW program. MacOS - LabVIEW Folder and System Folder. LabVIEW: LabVIEW and other associated files. Sun - LabVIEW Directory Other associated files. HP-UX - Same directory structure and contents as Sun except for GPIB. There are several other supporting programs. ibconf and ibic do the same thing as on the Sun.

5 Panel de Entrada a LabVIEW

6 Panel Ventana Principal
Barra de Herramientas Knob Control XY Graph

7 Panel del Diagrama Terminal de un Control Digital Alambre de Datos
Terminal de la perilla Constante numérica Terminal del gráfico Función para multiplicación Estructura For i=1 … N

8 Estatus barra de herramientas
Botón Run Botón Continuous Run Botón Abort Botón Pause/Continue Font características Alineamiento objetos Distribución de objetos Reordenar objetos Indicador Warning Botón de Enter Botones adicionales en la barra de herramientas Launch LabVIEW and discuss the buttons using the computer: Tools used to create, modify, debug, and execute VIs: Panel Toolbar: Located in the Panel window. Explain each button as described in the manual. Broken Run: Click on it to find errors. Continuous Run: Use for testing sections of code. Should use a while/for loop for repeating parts of a diagram in an application. Stop: Not a clean way to terminate the program. Avoid using it. Use a switch on the panel. Diagram Toolbar: Additional tools to debug the VI. Briefly explain each button. Tell the class we will discuss them in more detail when we talk about debugging. When running a VI, the font, alignment, and distribution rings disappear because they are editing tools. Botón Execution Highlighting Botón Step Into Botón Step Over Botón Step Out

9 Menus • Menus: Pull Down Menus rápidos de LabVIEW
Windows y UNIX – Click derecho sobre el objeto con el ratón (mouse) Pull-down menus contain options common to most Windows applications, as well as others that are particular to LabVIEW. Explain the menus using the computer: Don’t go into great detail. Discuss the “high points.” Point out the View Printed Manuals and WEB Resources (online support) in the Help menu. Show how to right click on an object. Let the class know that all objects can be right clicked on. Do not use the words ‘pop-up’. This phrase no longer exists in the LabVIEW dictionary and should not be used. You should use ‘right click’, or just ‘click’ on a Mac.

10 Paletas de Control y Funciones
Controles (Ventana Panel) Functions (Ventana Diagrama) Encontrar Subir un nivel Opciones del Browser Graphical, floating palettes. You can access the Controls palette only from the Panel window. You can access the Functions palette only from the Diagram window. If palettes are not displayed, you can access them via the Window menu and select the Show Functions/Controls palette. OR, right click on open area of panel or diagram window to display Controls and Functions palettes, respectively. Click on subpalettes to access functions, controls, VIs. You can tack down paletts and subpalettes using the pushpin. Tack down by clicking on the pushpin on the top left corner of the palette. Once tacked down you can set the palette options and use the find tool. Graficas: paletas flotantes Subpalettes pueden convertirse a flotantes

11 Opciones de la Ayuda (Help)
Mostrar menú de ayuda Ayuda: del diagrama Simple/Detallado Ayuda: Lock Ayuda: Online Contenido e Índice (Help menu) Todos los menús online Clic derecho sobre la función en diagrama para acceso a información online directa Use the Frequency Response example from the first exercise to demonstrate the Help window and online help. Suggestion: Open help and search the index using ‘menus’. You can then show the class where they can find information on the menu items discusses in the earlier slide.

12 RESUMEN Un VI tiene 3 componentes principales: panel principal, diagrama de bloques y el conector de iconos. El panel frontal es la interfase entre el usuario y el VI, el diagrama de bloques es el código ejecutable. Las opciones del menú dan acceso a diferentes facilidades de LabVIEW Se pueden usar rutas cortas para personalizar cualquier objeto (clic derecho en Windows) Uso de paletas flotantes, tanto para funciones como para controles

13 Lección 2 Creando, Editando, y Eliminando errores en un VI
Aprenderemos a: A: Como crear VIs B: Como Editar VIs C: Como corregir errores en un VIs Briefly explain the topics to be discussed in this lesson.

14 Creando el Panel Frontal de un VI
Controles numéricos e indicadores Controles Boleanos e indicadores Configurando controles e indicadores Uso de menús rápidos Las partes tienen diferentes menús Indicador Digital Rótulos Creating the front panel (user interface): Built with controls and indicators: Controls: Supply data to the VI. Indicators: Display data generated by the VI. Point out the difference of control vs. indicator terminal borders in the diagram window (controls have a thicker border) Also, they can find out if it is a control or indicator by checking the pop up menu of the object and referring to the third item (Change to Indicator or Change to Control) Explain graphics on slide: Numeric controls: Point out increment buttons. Numeric indicators: No increment buttons. Boolean objects: Ask class which Boolean is a control and which is an indicator. Control Digital Control Boleano Indicador Boleano Botones de Incremento

15 Accesando los Menús Rápidos
Clic derecho sobre el rótulo para su menú rápido Clic derecho sobre el display digital para su menú rápido Right-click menus: Most often used LabVIEW menus. Explain the different ways to pop up on each platform. Most LabVIEW objects have these menus for modification of attributes pertaining to that object. Functions/Controls palettes are available as right-click menus. Windows y UNIX: Clic-Derecho

16 Creando un Diagrama de Bloques VI
Ventana del Panel Ventana del Diagrama Terminales Del control Terminales del indicador The block diagram is the “code” for the VI. Note: Wires can cross each other. You will see a small gap in the wire. You can have bubbles at wire junctions by modifying Options (Tools menu)»Block Diagram and selecting Show dots at wire junctions. Composed of nodes, terminals, and wires: Nodes: Program execution elements (analogous to statements, functions, and subroutines). Functions: Built-in nodes for elementary functions. SubVIs: VIs you design and later call from the diagram of another VI. Structures: Control the program flow. El patrón de terminales De la función Add y de Función Subtract (tres nodos terminales). Alambres Nodos

17 Alambrando un Diagrama de Bloques
Escalar Arreglo1D Numérico Booleano String Naranja (punto flotante) Azul ( entero) Verde Purpura Arreglo 2D Explain the difference in colors. Explain that arrays and strings will be covered later in the course. Demonstrate wiring by placing two controls, one indicator, and an Add function. Use the Help window (point out how terminals in the Help window flash when the tool passes over the actual function terminal). Pop up on the Add function and select Show Terminals. Point out Tip Strips. Herramientas para alambrar Soldadura (Hot Spot) - Alambrado Automático - Tip´s - Clic-derecho en terminales y seleccionar Visible Items»Terminals - Ventana de ayuda

18 Programando Flujo de Datos
Un diagrama de bloques se ejecuta de izquierda a derecha y de arriba hacia abajo Los nodos se ejecutan cuando todos los datos están en las terminales de entrada Los nodos envían datos a todas las terminales de salida (output) una vez ejecutadas Data flow is the principle that governs how LabVIEW programs execute. Explain the diagram on this slide with emphasis on data flow. The node executes when data is available at all of its input terminals. The node supplies data on output terminals when it finishes execution. Not executed left to right nor top to bottom. If you have time, build the above diagrams on your computer and demonstrate the data flow using execution highlighting.

19 Buscando Controles, VIs, y Funciones
Presionar el botón de búsqueda, escribir el texto para iniciar la búsqueda Use los botones de arriba de las paletas de Controles y Funciones para navegar y buscar ciertos controles, VIs, y funciones. Use the buttons on top of the palette windows to navigate, search, and edit the palettes. You can search for controls, VIs, and functions that either contain certain words or start with certain words. Double clicking a search result opens the palette that contains the search result. You also can click and drag the name of the control, VI, or function directly to the front panel or block diagram.

20 Técnicas de Edición Creando Objetos desde ventana del Diagrama de bloques Seleccionado Objetos Moviendo y ajustando tamaño de objetos Borrando Objetos Undo y Redo Demonstrate the following on your computer. Selecting objects - Use the Positioning tool. Moving objects - Select and drag with mouse, or select and move with arrows (holding <Shift> restricts movement to horizontal or vertical). Deleting objects - Select and press <Delete> or use Cut or Clear in Edit menu. Labeling objects - Explain the differences between owned and free labels. Changing text - Highlight and use the Font Ring. Resizing objects - Use the Positioning tool, which changes to a frame at the object corner. Aligning and distributing objects - Select objects and use the ring controls in toolbar. Copying objects - Copy and Paste. Using color - Use Coloring (Paintbrush) tool and right-click on the object (T for transparent). Undo and Redo

21 Técnicas de Edición Etiquetas libre vs. etiquetas propias
Técnicas de alambrado Cambiando Fonts y colores de textos Copiando Objetos Usando Colores Demonstrate the following on your computer. Selecting objects - Use the Positioning tool. Moving objects - Select and drag with mouse, or select and move with arrows (holding <Shift> restricts movement to horizontal or vertical). Deleting objects - Select and press <Delete> or use Cut or Clear in Edit menu. Labeling objects - Explain the differences between owned and free labels. Changing text - Highlight and use the Font Ring. Resizing objects - Use the Positioning tool, which changes to a frame at the object corner. Aligning and distributing objects - Select objects and use the ring controls in toolbar. Copying objects - Copy and Paste. Using color - Use Coloring (Paintbrush) tool and right-click on the object (T for transparent). Undo and Redo

22 Técnicas para eliminación de errores (debugging)
Encontrando Ejecución por pasos Sonda Clic sobre el botón quebrado Run La ventana mostrara los errores Clic sobre el botón Execution Highlighting; el flujo de datos se ilumina. Los valores se van mostrando paso a paso. When your VI is not executable, a broken arrow is displayed in the Run button in the palette. Demonstrate debugging techniques on the computer: Finding Errors: To list errors, click on the broken arrow. To locate the bad object, click on the error message. Execution Highlighting: Animates the diagram and traces the flow of the data, allowing you to view intermediate values. Click on the light bulb on the toolbar. Probe: Used to view values in arrays and clusters. Click on wires with the Probe tool or right-click on the wire to set probes. Breakpoint: Set pauses at different locations on the diagram. Click on wires or objects with the Breakpoint tool to set breakpoints. Use Debug Demonstrate VI from BASICS.LLB to demonstrate the options and tools. Clic-derecho en alambre para desplegar una sonda, ésta mostrará el fuljo de datos a medida que fluyen en el segmento del alambre También puede seleccionar la sonda de la paleta de herramientas y dar clic sobre el alambre.

23 Técnicas para eliminación de errores (debugging)
Puntos de pausa (breakpoints) Boton de paso dentro, sobre y fuera para revisión paso a paso Seleccionar la herramienta breakpoint y haga clic en el alambre o nodo que desea pausar la ejecución Clic sobre botón Into para permitir tramos simples Una vez que se activa, el botón para en cada nodo Clic en botón Step Over para permitir tramos simples o paros sobre los nodos. Clic en Step Out para paros fuera de los nodos Single stepping: executes the diagram node by node. You can access single stepping from the diagram toolbar by using the step functions found on the diagram toolbar. Use Step Into/Step Over to begin single stepping. Step Into: Steps into a node. If there is a subVI, it will then bring up the subVI diagram and enable single stepping through it. Step Over: Executes nodes but visually does not single step through nodes. Step Out: Steps out of nodes, if the diagram has completed execution; click on Step Out to terminate single stepping mode. Demonstrate with Debug Demonstrate VI.

24 RESUMEN Se pueden colocar controles (inputs) e indicadores (outputs) en la ventana o panel principal Uso de herramientas operativas para manipular objetos del panel principal uso de herramientas para seleccionar, mover, redimensioanr objetos del panel. Uso de la herramienta alambrar para conectar los objetos del diagrama Las terminales de los controles tienen bordes más anchos que las terminales de los indicadores. Do not immediately display this slide. Suggested questions for class participation: What are the three main parts of a VI? What is a Boolean control? (Give an example.) What are the two main windows in the LabVIEW environment? What is the purpose of wiring? How can you tell if a VI is nonexecutable? What are shortcut menus? How are they used? What are some of the debugging tools available in the LabVIEW environment? Review slide: The purpose of Lesson Two was to introduce the LabVIEW editing and debugging techniques. When in doubt, right-click!! See the tips and tricks and the end of the chapter to practice while doing exercises.

25 RESUMEN Todos los objetos de LabVIEW tienen menús rápidos (shortcuts)
Alambrar es el mecanismo para controlar el flujo de datos y genera el programa de LabVIEW. Flecha quebrada de ejecución significa un VI con errores, no se puede ejecutar. Existen varias herramientas para operaciones de eliminación de errores, tales como: sondas, puntos de quiebra, ejecución paso a paso, etc.

26 Tips • Tip 1 – Commandos de teclado rapido
• Tip 2 – Llamar paleta de herramientas con <shift> click=derecho Tip 3 – Usar <Tab> para seleccionar tools; usar space bar para cambiar entre dos tipos comunes de herramientas usadas Tip 4 – Tools»Options selection – fijar preferencias de LabVIEW Tip 5 – Propiedades del VI (File menu) Tip 6 – Menu de herramientas- caracteristicas adicionales de ayuda en la administracion de los VI Tip 7 – Funciones Undo y Redo Windows <Ctrl-R> Ejecutar un VI <Ctrl-F> Encontrar un objeto <Ctrl-H> Activar la ventana de ayuda <Ctrl-B> Eliminar alambres dañados <Ctrl-W> Cerrar la ventana activa <Ctrl-E> Moverse entre ventanas panel/diagrama Demonstrate these techniques so that students can practice them throughout the course. Highlight the following tips: Hot keys (ctrl -b, ctrl-e, etc.) Accessing functions and controls palettes by right-clicking Accessing tools palette temporarily by shift - right-click (Windows) or shift - command - click (Mac) Tab to toggle through toolbars Spacebar to toggle between positioning and operating tool (panel toolbar) Spacebar to toggle between positioning and wiring tools (diagram toolbar) Wiring: spacebar to change direction Wiring: click with right mouse click to terminate wiring once started Undo and Redo in the Edit menu


Descargar ppt "Instrumentos Virtuales (VIs)"

Presentaciones similares


Anuncios Google