EE 200 Design Tools Laboratory 14

Slides:



Advertisements
Similar presentations
A. Virtual Instruments (VIs)
Advertisements

Previously… We created a simulated temperature reader which alerts if too hot or too cold… Download the solved practice to keep in sync: Thermostat.vi.
LabVIEW is a graphical programming development environment for data acquisition and control, data analysis, and data presentation. With LabVIEW you can.
Lesson 2 Navigating LabVIEW
Based on LabVIEW 2011 Student Edition
Diego Torres LabVIEW Student Ambassador Fall 2011 ITESM CQ
TE Sessions Supported by: Basic Concepts of Programming November 3, 2012.
Using Macros and Visual Basic for Applications (VBA) with Excel
Welcome! Workshop 2 of 7.
Developing User Interfaces with Event-driven Programming
Introduction to LabVIEW
Introduction to LabVIEW 8.5
CS320n –Visual Programming LabVIEW Foundations. Visual ProgrammingLabVIEW Foundations2 What We Will Do Today Hand back and review the midterm Look at.
Introduction to LabVIEW Seth Price Department of Chemical Engineering New Mexico Tech Rev. 10/5/14.
Infinity-project.org Engineering education for today’s classroom The Infinity Project SM LabVIEW for The Infinity Project.
Workshop 3 of 7 Welcome!. Today's Topics Review of Workshop 2 Loops While For Auto-indexing Shift registers Case Structure.
V1: HMFR, V2: MFNB, 2007 LabView Seminar University of Puerto Rico Mayagüez Campus.
Design of Bio-Medical Virtual Instrumentation Tutorial 1.
Virtual Instrumentation With LabVIEW. Course Goals Understand the components of a Virtual Instrument Introduce LabVIEW and common LabVIEW functions Create.
MCEN 371 – Mechanical Engineering Lab Chapter 6: LabVIEW Part 1: Introduction.
Virtual Instrumentation With LabVIEW. Front Panel Controls = Inputs Indicators = Outputs LabVIEW Programs Are Called Virtual Instruments (VIs) Block Diagram.
LabVIEW an Introduction
Introduction to LabVIEW
Each VI has 2 Windows Front Panel User Interface (UI) –Controls = Inputs –Indicators = Outputs Block Diagram Graphical Code –Data travels on wires from.
LabView instrumentoinnissa, 55492, 3op Labview in instrumentation Lecturer: Heikki Ojala, room C204a
Creating, Editing, & Debugging a VI A.How to Create VIs B.How to Edit VIs C.How to Debug VIs You Will Learn:
Digital Electronics and Computer Interfacing Tim Mewes 4. LabVIEW - Advanced.
Introduction to LabVIEW 8.5
Lab 1 : Introduction to LabView 1 Southern Methodist University Bryan Rodriguez.
Design of Bio-Medical Virtual Instrumentation Tutorial 2.
CS320n –Visual Programming More LabVIEW Foundations.
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 9 Arrays  Read Bishop, Sections 6.1 to 6.3.  Homework #9 and Lab #9 due next week.  Quiz #5 next.
Workshop 2 of 4 Welcome!. Survey While You Wait ni.com/duke >> Recent Documents >> LabVIEW Workshop Participation Survey.
Digital Electronics and Computer Interfacing Tim Mewes 2. LabVIEW Basics part II.
LabVIEW Course Course 2.
MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
Introduction to LabVIEW. Overview Objectives Background Materials Procedure Report/Presentation Closing.
Week 3 Data Structures and Common Tools. Common Tools in Labview Automatic Tool Selector Using the Operating Tool Using the Positioning Tool to Select.
Workshop 5 of 7 Welcome!. Today's Topics Review from Workshop 4 Modularity & subVIs Documentation File Input/Output Introduction.
Week 3 Labview exercises
Lesson 7 Using Sequential and State Machine Algorithms
Visual Basic.NET Windows Programming
Introduction to LabVIEW
Welcome! Workshop 3 of 7.
Quiz Which types of folders are available in a LabVIEW Project?
LabVIEW Core 1 Key messages for the instructor:
Computer Architecture
Getting Started with LabVIEW Virtual Instruments
EET 2259 Unit 5 Loops Read Bishop, Sections 5.1 and 5.2.
EET 2259 Unit 3 Editing and Debugging VIs
Chap 7. Building Java Graphical User Interfaces
Course Learning Map Lesson # Lesson Title Lesson 3 Lesson 2 Lesson 1
Introduction to LabVIEW
הודעות-שיעור1 שי שרעבי חדר 201
Lab 2 : Structures Muhammad Zaigham Abbas Shah DIGITAL INSTRUMENTATION SYSTEMS.
Lesson 2: Introduction to Control programming using Labview
הודעות ריענון מהיר והרחבות Charts & Graphs גרף XY בניית מחולל אותות
הודעות ריענון מהיר והרחבות כתיבה לקובץ Low-Level דגימת אות Low-Level
EET 2259 Unit 5 Loops Read Bishop, Sections 5.1 and 5.2.
Introduction to LabVIEW
Introduction to LabVIEW
Structures- case, sequence, formula node
EET 2259 Unit 9 Arrays Read Bishop, Sections 6.1 to 6.3.
MECH 3550 : Simulation & Visualization
Introduction to LabVIEW
LabVIEW基礎課程(一) 參考書籍: LabVIEW for Everyone (Jeffrey Travis/Jim Kring)
EET 2259 Unit 7 Case Structures; Sequence Structures
EET 2259 Unit 5 Loops Read Bishop, Sections 5.1 and 5.2.
EET 2259 Unit 2 Virtual Instruments
EET 2259 Unit 3 Editing and Debugging VIs
Presentation transcript:

EE 200 Design Tools Laboratory 14

Laboratory 14 Topics LabVIEW Programming Properties of Front Panel Objects Implicitly and Explicitly Linked Property Nodes Control References Event programming and the Val(Sgnl) property

Properties of Front Panel Objects Front panel objects have properties Properties are attributes that describe the object Numerous properties describe appearance: Color Visibility Position Numeric display format Value Property nodes alter the properties of objects

Property Nodes Property nodes allow you to programmatically set the properties of front panel objects Property nodes can be configured to read or write a given property Property nodes can be explicitly or implicitly linked to front panel objects Implicitly linked property nodes are tied to a specific front panel object Explicitly linked property nodes must be linked to front panel objects using control references

Implicitly Linked Property Nodes Right click front a panel object and select Create >> Property Node In the above example, the implicitly linked property node allows us to read the value of the control

Property Node Attributes Right click on the property node Click on Change to Write In the above example, the implicitly linked property node allows us to write a value to the control

Exercise 1 Open Exercise_1.vi Use implicitly linked property nodes to Set LED Control/Indicator visible or invisible Set LED Control status: enabled, disabled, or disabled and grayed out Set the LED Indicator to blink, or not to blink Change the LED Indicator color

Exercise 1

Exercise 1 Set the LED Color using a Color Box Control

Exercise 1 Set the default colors for the LED Left-click the middle of the color constant box to open the color palette; use the values shown

Property Node Execution Order The property node does not execute if the status of the input error cluster is true The node executes from top to bottom By default, if an error occurs on a terminal, the node stops at that terminal, returns an error, and does not execute any further terminals To override this behavior, right-click and select Ignore Errors Inside Node

Exercise 2 Open Exercise_2.vi The default values for both indicators are zero After the VI executes, what do the indicators display? Verify by executing Exercise_2.vi Why does Numeric Indicator 1 display 2 rather than 3?

Control Reference A control reference (refnum) in LabVIEW is analogous to a pointer in C A control reference, or pointer, represents an address A control reference to a front panel object represents an address to the front panel control

Creating a Control Reference Right click the front panel object Select Create >> Reference

Explicitly Linked Property Nodes Programming >> Application Control

Explicitly Linked Property Nodes Link the property node to the front panel object using a control reference (refnum) Right click the property node to set its attributes refnum

Exercise 3 Modify the Exercise_1.vi so that is uses explicitly linked property nodes

Exercise 4 Open Exercise_4.vi Use an explicitly linked reference node and an array of control references to set the min and max range of the three control knobs

Exercise 4

Boolean Control Property Node When a Boolean control is set to a latching mechanical action, after you change the value of the Boolean control, it will change back to the default once the VI reads its value Depending on when the value of the Boolean control is read by the VI or by the property node, you may miss a change in the value For this reason, use a switched mechanical action if you wish to change a Boolean control using a property node

Event Programming Events are notification that something has occurred Events originate from the user interface, external I/O, or other parts of the program Clicking the mouse generates a mouse event Event-Driven Programming is a method of programming where the program waits on an event to occur before executing one or more functions

Types of Events Static events are only for interactions with the front pane A static, notify event would be a “Value Change” for an OK button Dynamic events are for interactions with any part of your block diagram A rising edge on a signal connected to DAQ device

The Event Structure Examples of User Interface (Static) Events Pressing a button on the mouse Pressing a key on the keyboard Changing the value of a numeric control

Parts of an Event Structure Event Selector Label—Identifies event case viewed Timeout—Value in ms to wait for events; default value is –1 (indefinite)

Parts of an Event Structure Event Data Node—Identifies the data LabVIEW provides when the event occurs; similar to the Unbundle By Name function Event Filter Node—Identifies the subset of data available in the Event Data node that the event case can modify

Using an Event Structure Normally contained within a while loop Event structure handles exactly one event per iteration Sleeps when no events occur Minimize the code appearing in the event structure

Exercise 5 Open Exercise_5.vi

Exercise 5 The Stop button uses latched mechanical action while the Refresh button uses switched mechanical action The Loop Iteration indicator shows the number of times the Refresh button is read The code polls the Refresh and Stop buttons every 10 ms Polling is not efficient While the processor is looping and reading controls, it is not executing other code

Exercise 5 Avoid polling the front panel controls by using the event structure on slide 30 Add events as shown on slide 31 The Stop Boolean control uses latched mechanical action and must be located inside the event case to work correctly Verify that the Loop Iteration indicator increments only when the Refresh button is pressed

Exercise 5

Exercise 5

Val(Sgnl) Property Node Suppose we change the value of the Refresh button in Exercise 5 using a property node The properties Value and Val(sgnl) both change the value of the front panel object, but only the Val(sgnl) property generates a Valued Changed Event within an event structure

Exercise 6 Save Exercise_5.vi as Exercise_6.vi Eliminate the Wait Until Next ms Multiple node Not needed when the loop contains an event structure Add a Boolean control Trigger Refresh that uses switched when released mechanical action Add an event case that executes when the value of the Trigger Refresh control changes value Within the new event case Use a Value property node to set the Refresh control to true Use a Value property node to set the Trigger Refresh control to false

Exercise 6

Exercise 6 Start the VI Press the Refresh Trigger control Does the color of the Refresh Button change? Does the One Button Dialog box appear? Does the Loop Iterations indicator increment? Use a Val(Sgnl) property node to set the Refresh control to true Does pressing the Refresh Trigger control button now cause the One Button Dialog box to appear?

Exercise 6