Hands-On: Introduction to Object-Oriented Programming in LabVIEW



Similar documents
EET 310 Programming Tools

LabVIEW Day 1 Basics. Vern Lindberg. 1 The Look of LabVIEW

Lab 3: Introduction to Data Acquisition Cards

Getting Started with the LabVIEW Mobile Module Version 2009

Exercise 10: Basic LabVIEW Programming

Installing S500 Power Monitor Software and LabVIEW Run-time Engine

MICROSOFT OUTLOOK 2010 WORK WITH CONTACTS

SFTP Server User Login Instructions. Open Internet explorer and enter the following url:

Windows XP File Management

How to Download Images Using Olympus Auto-Connect USB Cameras and Olympus Master

TestManager Administration Guide

LabVIEW Lesson 5 Clusters

DSP Laboratory: Analog to Digital and Digital to Analog Conversion

NVMS User Manual

Administrator s Guide

Data Acquisition Using NI-DAQmx

Application Note. Example of user log on Magelis HMI with XB5S5B2L2 biometric switch. Advanced Technical Support - Brazil. Version: 1.

Instructions for downloading and installing the GPS Map update

Administrator s Guide

Windows XP Home Edition / Windows XP Professional

BIGPOND ONLINE STORAGE USER GUIDE Issue August 2005

Virtual Office Remote Installation Guide

Windows XP Home Edition / Windows XP Professional

Transitioning from TurningPoint 5 to TurningPoint Cloud - LMS 1

How To Use Mview On A Powerline 2.2 (Powerline) On A Pc Or Macbook 2 (Powerplst) On An Iphone Or Ipa 2 (Aldo) On Your Iphon 2 (

Create, Link, or Edit a GPO with Active Directory Users and Computers

Altaro Hyper-V Backup - Getting Started

SOS SO S O n O lin n e lin e Bac Ba kup cku ck p u USER MANUAL

NETWORK PRINT MONITOR User Guide

User s Manual of DVR DVS Remote Client Software V 4.0.1

Introduction to LabVIEW for Control Design & Simulation Ricardo Dunia (NI), Eric Dean (NI), and Dr. Thomas Edgar (UT)

Remote Storage Area (RSA) Basics

TREND series H.264 DVR Central Management System Quick User Guide

WA Manager Alarming System Management Software Windows 98, NT, XP, 2000 User Guide

File Manager Pro User Guide. Version 3.0

Lab 4 - Data Acquisition

Reading and Writing Files Using the File Utilities service

Non-ThinManager Components

WebMeter Internal Web Server Feature

Migrating a Windows PC to Run in VMware Fusion VMware Fusion 2.0

Installation Guidelines (MySQL database & Archivists Toolkit client)

Windows XP Home Edition / Windows XP Professional

ODBC Driver Version 4 Manual

Lab View with crio Tutorial. Control System Design Feb. 14, 2006

Changing Your Cameleon Server IP

How to Configure Windows 8.1 to run ereports on IE11

KEYWORDS InteractX, database, SQL Server, SQL Server Express, backup, maintenance.

Working With Your FTP Site

Learning Remote Control Framework ADD-ON for LabVIEW

Visual Basic. murach's TRAINING & REFERENCE

Configuration Manager

Course: WIN310. Student Lab Setup Guide. Summer Microsoft Windows Server 2003 Network Infrastructure (70-291)

Using FileMaker Pro with Microsoft Office

USING STUFFIT DELUXE THE STUFFIT START PAGE CREATING ARCHIVES (COMPRESSED FILES)

Quick Start Using DASYLab with your Measurement Computing USB device

Using Flow Control with the HEAD Recorder

Viewing and Troubleshooting Perfmon Logs

idvr-pro Viewer Software for Mac User Manual ver 0.1

Mapping with CMap Software Jamie Armstrong

Configuration and Access of FTP Server

6. If you want to enter specific formats, click the Format Tab to auto format the information that is entered into the field.

VirtualXP Users Guide

State of Ohio DMS Solution for Personnel Records Training

Plug-In for Informatica Guide

Ohio University Computer Services Center August, 2002 Crystal Reports Introduction Quick Reference Guide

The following pages will help you to solve issues linked to the installation and first use of the Wintech Manager software and Wintech USB computer.

January 9, Xerox Global Print Driver Installation Guide

Hosted VoIP Outlook TAPI Integration

STEP 7 MICRO/WIN TUTORIAL. Step-1: How to open Step 7 Micro/WIN

LSR4300 Control Center Software

Team Foundation Server 2012 Installation Guide

Listeners. Formats. Free Form. Formatted

Legal Notes. Regarding Trademarks KYOCERA Document Solutions Inc.

Working with SQL Server Integration Services

FTP Server Application Guide REV:

ONcbx Feature Guide UC Desktop Client

XConsole GUI setup communication manual September 2010.

owncloud Configuration and Usage Guide

1. Installing The Monitoring Software

Colorfly Tablet Upgrade Guide

Rev. 06 JAN Document Control User Guide: Using Outlook within Skandocs

LPR for Windows 95/98/Me/2000/XP TCP/IP Printing User s Guide. Rev. 03 (November, 2001)

Connecting Your Camera under Windows XP

Online Backup and Recovery Manager Setup for Microsoft Windows.

Clustering ExtremeZ-IP 4.1

Laptop Backup - User Guide (Windows)


Updated 08/2015. Wire Transfer User Guide

Copyright 2011 Linear Technology. All rights reserved.

Getting Started with the Aloha Community Template for Salesforce Identity

LabVIEW Day 6: Saving Files and Making Sub vis

Purple Mash Shared Folders

Xerox Global Print Driver. Installation Guide

Software for Producing Rack Layouts and Purchase Orders

Installing LearningBay Enterprise Part 2

GE Intelligent Platforms. Activating Licenses Online Using a Local License Server

Transcription:

Version 13.11 1 Hr Hands-On: Introduction to Object-Oriented Programming in LabVIEW Please do not remove this manual. You will be sent an email which will enable you to download the presentations and an on-line version of this manual Thank you! uk.ni.com ireland.ni.com

Hardware Requirements:- None Required Software Requirements:- LabVIEW 2013

Object Oriented Programming Hands On 1. Launch LabVIEW from Start>>All Programs>> National Instruments>> LabVIEW 20XX. 2. On the splash-screen, click on Create Project to create a new project. 3. Navigate to Hands On in the left side of the window, select the LabVIEW category and double-click the OOP Hands On as shown below. 4. Navigate to LabVIEW and a window will prompt you to configure the new project as shown below. Save it to a folder of your choice.

Exercise 1 Concept The aim of this exercise is to add a message popup to a base VI to show dynamic dispatch. 1. Open the OOP Hands On Project in the Exercises folder. 2. Expand the Classes virtual folder and then the Message Child Classes virtual folder. 3. Right click on the Message Child Classes virtual folder and select New>>Class 4. Change the name to Popup 5. Click OK 6. Double Click the Popup.ctl to open it. Drop a String control into the Cluster of Private Class Data. Re-label this to Message String.

7. Close the Popup.ctl and click save. Save the Popup.lvclass file in the exercise1 folder 8. Right click Popup.lvclass in your project and select Properties 9. Then select Inheritance, and click the button Change Inheritance 10. Select Message.lvclass, and click Inherit From Selected and then click OK 11. Now we must create the Accessor Methods for the data in the class. 12. Right click Popup.lvclass and select New>>VI for Data Member Access. 13. Change the Access mode to Read and Write and ensure that the Make available through Property Nodes and Create dynamic accessor options are selected as shown below. Click on Create. 14. A Write Message String and Read Message String VI should be created for you, Close these and save to the folder Exercise 1

15. Right click Popup.lvclass in the project and select New>>VI for Override, then click OK (There is only one method to select, the Execute Method) 16. Go to the block diagram of the created VI. Delete the Call Parent Method VI and then use Ctrl B to delete the broken wires 17. Create more space in the centre of the block diagram and place a case structure. You can do this by holding Ctrl, left clicking the mouse and dragging an area on the screen. 18. Wire it as shown below 19. Return to the No Error case. Drag a Read Message String in from your project and wire the Error lines and the Popup class wires through it.

20. Add a One Button Dialog from the functions palette, Programming>>Dialog & User Interface>>One Button Dialog, then wire the Message String from the Read Message String VI to the message input of the One Button Dialog VI. 21. Close the VI and save it in the Exercise 1 folder. Do NOT change the name of the VI. 22. Open the OOP Advanced with Commands VI from the Project Explorer. We will call your new method from here. 23. Create a new Boolean button from the controls palette System>>Boolean>>System Button. (This will keep the style of the Front Panel). Change the label to Display Message. 24. Also create a string control. System>>String and Path>>System String. Change the label to Message String. 25. Switch to the Block Diagram. Navigate the Event Structure to Frequency :Mouse Up 26. Right click and Duplicate Event Case. Select Display Message and Mouse>>MouseUp, then click OK

27. Delete the control Frequency 2, the Write Frequency Message VI and the class constant. 28. Drag Popup.lvclass and Write Message String.vi from the project into the event case. Move the Message String control into the case as well. 29. Wire the class constant to the Write Message String VI and then into the Enqueue Element VI. Wire the Message String control to the Message String input of the Write Message String VI. 30. Switch to the front panel and save then Run the VI. Enter a message and click the Display Message button. Your message will appear. If you Generate a signal, you must move the Frequency dial first to send the message. Exercise 2 Concept The aim of this exercise is to add a class to turn our function generator into an arbitrary waveform generator by loading in a waveform from a selection on disk. Add functionality with no architecture change. 1. Open the OOP Advanced with Commands and Factory VI from the project. Run this and experiment with the drop down box to load the different classes from disk and execute their methods. Note the options in the drop down box. 2. Stop the VI and close it. 3. In the project navigate to Classes>>Generation Class>>Generate Child Classes 4. Right click on Generate Child Classes and go to New>>Class

5. Name the class Gen Arb and click OK 6. Right click on Gen Arb.lvclass in the project and navigate to properties and then Inheritance. 7. Click Change Inheritance. 8. Select Generate.lvclass and then Inherit from Selected, then OK 9. Right click on Gen Arb.lvclass in the project and navigate to VI for Override... 10. Click OK. The only method available should be Generate.vi 11. Go to the block diagram of the created VI. Delete the Call Parent Method VI and then use Ctrl B to delete the broken wires. 12. Create more space in the centre of the block diagram and place a case structure. 13. Wire it as shown below 14. Go back to the No Error case.

15. Go to Express>>Input>>File Dialog and drop this into the No Error case. Just click OK to the Dialog that pops up. 16. Drop down a Read From XML File. Programming>>File I/O>>XML>>LabVIEW Schema>>Read from XML File. Select the String option in the polymorphic drop down. 17. Drop down an Unflatten from XML VI. Programming>>File I/O>>XML>>LabVIEW Schema>>Unflatten from XML. 18. Drop down a Waveform constant. Programming>>Waveform>>Analog Waveform>>Waveform Constant. 19. In the project navigate to Advanced Waveform.lvclass and then Waveform. Expand this and then drag in a Write Waveform method. Add an Enqueue Element VI from Programming>>Synchronization>>Queue Operations>> Enqueue Element. 20. a. Wire the Selected path of the File Dialog to the XML File Path of the Read from XML File. b. Wire from XML Elements output of this VI to the xml string input of the Unflatten from XML VI. c. Wire the waveform constant to the Type input of this VI. d. Wire from the value of the Unflatten from XML VI to the waveform input of the Write Waveform VI. e. Wire the Advanced Waveform class through the Write Wavefrom VI. Wire the Message Queue through the Enqueue Element VI. f. Connect the Error Out of the Write Waveform VI to the Error In of the Enqueue Element VI. g. In the project navigate to Message Child Classes. Drag the Display Message.lvclass into the VI.