LabVIEW Real-Time 1 Exercises - CERN

Transcription

NatiNo onatF lIor nstDi rumstribu enttio snLabVIEWTM Real-Time 1ExercisesCourse Software Version 2010September 2010 EditionPart Number 325583A-01LabVIEW Real-Time 1 ExercisesCopyright 2009–2010 National Instruments Corporation. All rights reserved.Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical, including photocopying, recording,storing in an information retrieval system, or translating, in whole or in part, without the prior written consent of National Instruments Corporation.National Instruments respects the intellectual property of others, and we ask our users to do the same. NI software is protected by copyright and other intellectual property laws.Where NI software may be used to reproduce software or other materials belonging to others, you may use NI software only to reproduce materials that you may reproduce in accordancewith the terms of any applicable license or other legal restriction.For components used in USI (Xerces C , ICU, HDF5, b64, Stingray, and STLport), the following copyright stipulations apply. For a listing of the conditions and disclaimers, refer to eitherthe USICopyrights.chm or the Copyrights topic in your software.Xerces C . This product includes software that was developed by the Apache Software Foundation (http://www.apache.org/). Copyright 1999 The Apache Software Foundation.All rights reserved.ICU. Copyright 1995–2009 International Business Machines Corporation and others. All rights reserved.HDF5. NCSA HDF5 (Hierarchical Data Format 5) Software Library and UtilitiesCopyright 1998, 1999, 2000, 2001, 2003 by the Board of Trustees of the University of Illinois. All rights reserved.b64. Copyright 2004–2006, Matthew Wilson and Synesis Software. All Rights Reserved.Stingray. This software includes Stingray software developed by the Rogue Wave Software division of Quovadx, Inc. Copyright 1995–2006, Quovadx, Inc. All Rights Reserved.STLport. Copyright 1999–2003 Boris FomitchevTrademarksLabVIEW, National Instruments, NI, ni.com, the National Instruments corporate logo, and the Eagle logo are trademarks of National Instruments Corporation. Refer to the TrademarkInformation at ni.com/trademarks for other National Instruments trademarks.Other product and company names mentioned herein are trademarks or trade names of their respective companies.PatentsFor patents covering National Instruments products/technology, refer to the appropriate location: Help»Patents in your software, the patents.txt file on your media, or theNational Instruments Patent Notice at ni.com/patents.

NatiNo onatF lIor nstDi rumstribu enttio snWorldwide Technical Support and Product Informationni.comNational Instruments Corporate Headquarters11500 North Mopac Expressway Austin, Texas 78759-3504Worldwide OfficesUSA Tel: 512 683 0100Australia 1800 300 800, Austria 43 662 457990-0, Belgium 32 (0) 2 757 0020, Brazil 55 11 3262 3599, Canada 800 433 3488, China 86 21 5050 9800,Czech Republic 420 224 235 774, Denmark 45 45 76 26 00, Finland 358 (0) 9 725 72511, France 01 57 66 24 24, Germany 49 89 7413130, India 91 80 41190000,Israel 972 3 6393737, Italy 39 02 41309277, Japan 0120-527196, Korea 82 02 3451 3400, Lebanon 961 (0) 1 33 28 28, Malaysia 1800 887710, Mexico 01 800 010 0793,Netherlands 31 (0) 348 433 466, New Zealand 0800 553 322, Norway 47 (0) 66 90 76 60, Poland 48 22 328 90 10, Portugal 351 210 311 210, Russia 7 495 783 6851,Singapore 1800 226 5886, Slovenia 386 3 425 42 00, South Africa 27 0 11 805 8197, Spain 34 91 640 0085, Sweden 46 (0) 8 587 895 00, Switzerland 41 56 2005151,Taiwan 886 02 2377 2222, Thailand 662 278 6777, Turkey 90 212 279 3031, United Kingdom 44 (0) 1635 523545To comment on National Instruments documentation, refer to the National Instruments Web site at ni.com/info and enter the Info Code feedback.

Student GuideNatiNo onatF lIor nstDi rumstribu enttio snContentsA. NI Certification .vB. Course Description.viC. What You Need to Get Started.viD. Installing the Course Software.viiE. Course Goals .viiiF. Course Conventions.ixLesson 1Introduction to Real-TimeExercise 1-1Project Specification Document .1-1Lesson 2Configuring Your HardwareExercise 2-1Exercise 2-2Configure Hardware .2-1Targeting Real-Time Hardware .2-10Lesson 3Real-Time Architecture: DesignExercise 3-1Exercise 3-2Exercise 3-3Priority Levels.3-1Inter-Task Communication Using Shared Variables .3-5Course Project: Requirements Document.3-19Lesson 4Timing Applications and Acquiring DataExercise 4-1Exercise 4-2 National Instruments CorporationSoftware Timing .4-1Course Project: Deterministic Loop .4-5iiiLabVIEW Real-Time 1 Exercises

Lesson 5CommunicationExercise 5-1Exercise 5-2Exercise 5-3NatiNo onatF lIor nstDi rumstribu enttio snContentsCourse Project: Creating the Target VI .5-1Course Project: Creating the Project Host VI .5-17Network Streams.5-25Lesson 6Verifying Your ApplicationExercise 6-1Distributed System Manager .6-1Lesson 7Deploying Your ApplicationExercise 7-1Lesson ACourse SlidesLabVIEW Real-Time 1 ExercisesDeploy an Application .7-1ivni.com

NatiNo onatF lIor nstDi rumstribu enttio snStudent GuideThank you for purchasing the LabVIEW Real-Time 1 course kit. This course manual and the accompanyingsoftware are used in the 2-day, hands-on LabVIEW Real-Time 1 course.You can apply the full purchase price of this course kit toward the corresponding course registration fee ifyou register within 90 days of purchasing the kit. Visit ni.com/training to register for a course and toaccess course schedules, syllabi, and training center location information.NoteFor course manual updates and corrections, refer to ni.com/info and enter the Info Code lvrt1.A. NI CertificationThe LabVIEW Real-Time 1 course is part of a series of courses designed to build your proficiency withLabVIEW and help you prepare for exams to become an NI Certified LabVIEW Developer and NI CertifiedLabVIEW Architect. The following illustration shows the courses that are part of the LabVIEW trainingseries. Refer to ni.com/training for more information about NI Certification.New UserExperienced UserAdvanced UserLabVIEW Core 1*LabVIEW Core 3*Managing SoftwareEngineering in LabVIEWCoursesLabVIEW Core 2*LabVIEW OOP System DesignAdvanced Architecturesin LabVIEWCertificationsCertified LabVIEWAssociate Developer ExamCertified LabVIEWDeveloper ExamCertified LabVIEWArchitect ExamOther CoursesLabVIEW Instrument ControlLabVIEW FPGALabVIEW ConnectivityLabVIEW Machine VisionModular Instruments SeriesLabVIEW PerformanceLabVIEW Real-TimeLabVIEW DAQ and Signal Conditioning*Core courses are strongly recommended to realize maximum productivity gains when using LabVIEW. National Instruments CorporationvLabVIEW Real-Time 1 Exercises

Student GuideNatiNo onatF lIor nstDi rumstribu enttio snB. Course DescriptionThe LabVIEW Real-Time 1 course teaches you to use LabVIEW Real-Time to develop a deterministic andreliable application. Most LabVIEW applications run on a general-purpose operating system (OS) likeWindows, Linux, Solaris, or Mac OS. Some applications require deterministic real-time performance thatgeneral-purpose operating systems cannot guarantee. The LabVIEW Real-Time Module extends thecapabilities of LabVIEW to address the need for deterministic real-time performance.This course assumes you have a level of experience with LabVIEW equivalent to completing the materialin the LabVIEW Core 1 course. In addition, you should be familiar with the Windows operating system andcomputer components such as the mouse, keyboard, connection ports and plug-in slots, and have experiencewriting algorithms in the form of flowcharts or block diagrams. The course and exercise manuals are dividedinto lessons, described as follows.In the course manual, each lesson consists of the following: An introduction that describes the purpose of the lesson and what you will learn A description of the topics in the lesson A summary quiz that tests and reinforces important concepts and skills taught in the lessonIn the exercise manual, each lesson consists of the following: A set of exercises to reinforce topicsC. What You Need to Get StartedBefore you use this course manual, make sure you have the following items: Computer running Windows 7/Vista/XP/2000 LabVIEW Full Development System version 2010 or later LabVIEW Real-Time Module version 2010 or later Temperature Chamber including a 12 volt fan, lamp, and a J-type thermocoupleLabVIEW Real-Time 1 Exercisesvini.com

Student GuideNatiNo onatF lIor nstDi rumstribu enttio sn cRIO-9074 integrated chassis and controller with a cRIO-9211 thermocouple module and a cRIO-9474digital output module LabVIEW Real-Time 1 Exercises LabVIEW Real-Time 1 CD, which contains the following files:FilenameDescriptionExercisesA folder containing all files needed to complete theexercisesSolutionsA folder containing the solutions to each exerciseLabVIEW-RT.pdfLabVIEW Real-Time 1 Course ManualD. Installing the Course SoftwareInsert the course CD and follow the onscreen instructions to install the software.Exercise files are located in the Exercises \LabVIEW Real-Time 2\ folder, where Exercises represents the path to the Exercises folder on the root directory of your computer. National Instruments CorporationviiLabVIEW Real-Time 1 Exercises

Student GuideNatiNo onatF lIor nstDi rumstribu enttio snE. Course GoalsThis course presents the following topics: Concepts of real-time and determinism Configuring and communicating with real-time hardware Understanding memory usage, multithreading, priorities, and shared resource in theLabVIEW Real-Time Module Communicating between a host computer and RT target over the network Developing a deterministic, reliable applicationThis course does not present any of the following topics:LabVIEW Real-Time 1 Exercises Information and concepts covered in LabVIEW Core 1 course Control, PID, and/or Fuzzy Logic theory Analog-to-digital (A/D) theory Operation of GPIB, RS-232, Motion, CAN, or VISA Every built-in LabVIEW object, function, or library VI; refer to the LabVIEW Help for moreinformation about LabVIEW features not described in this course Development of a complete application for any student in the class; refer to the NI Example Finder,available by selecting Help»Find Examples for example VIs you can use and incorporate into VIsyou createviiini.com

Student GuideNatiNo onatF lIor nstDi rumstribu enttio snF. Course ConventionsThe following conventions are used in this course manual:»The » symbol leads you through nested menu items and dialog box options to a final action. The sequenceOptions»Settings»General directs you to pull down the Options menu, select the Settings item, and selectGeneral from the last dialog box.This icon denotes a note, which alerts you to important information.bolditalicmonospacemonospace boldmonospace italic National Instruments CorporationBold text denotes items that you must select or click in the software, such as menu items and dialog boxoptions. Bold text also denotes parameter names, controls and buttons on the front panel, dialog boxes,sections of dialog boxes, menu names, and palette names.Italic text denotes variables, emphasis, a cross-reference, or an introduction to a key concept. Italic text alsodenotes text that is a placeholder for a word or value that you must supply.Text in this font denotes text or characters that you enter from the keyboard, sections of code, programmingexamples, and syntax examples. This font also is used for the proper names of disk drives, paths, directories,programs, subprograms, subroutines, device names, functions, operations, variables, filenames, andextensions

LabVIEW Core 3* LabVIEW OOP System Design LabVIEW Connectivity LabVIEW Performance LabVIEW Instrument Control LabVIEW Machine Vision LabVIEW Real-Time LabVIEW FPGA Modular Instruments Series LabVIEW DAQ and Signal Conditioning Managing Software National Engineering in LabVIEW Instruments Not For Distribution. Student Guide LabVIEW Real-Time 1 Exercises vi