
Data Acquisition Toolbox For Use with MATLAB® Computation Visualization Programming User’s Guide Version 2 How to Contact The MathWorks: www.mathworks.com Web comp.soft-sys.matlab Newsgroup [email protected] Technical support [email protected] Product enhancement suggestions [email protected] Bug reports [email protected] Documentation error reports [email protected] Order status, license renewals, passcodes [email protected] Sales, pricing, and general information 508-647-7000 Phone 508-647-7001 Fax The MathWorks, Inc. Mail 3 Apple Hill Drive Natick, MA 01760-2098 For contact information about worldwide offices, see the MathWorks Web site. Data Acquisition Toolbox User’s Guide COPYRIGHT 1999 - 2002 by The MathWorks, Inc. The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. No part of this manual may be photocopied or repro- duced in any form without prior written consent from The MathWorks, Inc. FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by or for the federal government of the United States. By accepting delivery of the Program, the government hereby agrees that this software qualifies as "commercial" computer software within the meaning of FAR Part 12.212, DFARS Part 227.7202-1, DFARS Part 227.7202-3, DFARS Part 252.227-7013, and DFARS Part 252.227-7014. The terms and conditions of The MathWorks, Inc. Software License Agreement shall pertain to the government’s use and disclosure of the Program and Documentation, and shall supersede any conflicting contractual terms or conditions. If this license fails to meet the government’s minimum needs or is inconsistent in any respect with federal procurement law, the government agrees to return the Program and Documentation, unused, to MathWorks. MATLAB, Simulink, Stateflow, Handle Graphics, and Real-Time Workshop are registered trademarks, and TargetBox is a trademark of The MathWorks, Inc. Other product or brand names are trademarks or registered trademarks of their respective holders. Printing History: May 1999 First printing New for Version 1 November 2000 Second printing Revised for Version 2 (Release 12) June 2001 Third printing Revised for Version 2.1 (Release 12.1) July 2002 Online only Revised for Version 2.2 (Release 13) Contents Preface What Is the Data Acquisition Toolbox? . xii Exploring the Toolbox . xii Related Products . xiii Using This Guide . xiv Expected Background . xiv Using the Documentation Examples . xv How This Guide Is Organized . xv Installation Information . xvii Toolbox Installation . xvii Hardware and Driver Installation . xvii Typographical Conventions . xviii Introduction to Data Acquisition 1 Anatomy of a Data Acquisition Experiment . 1-2 The Data Acquisition System . 1-3 Data Acquisition Hardware . 1-5 Sensors . 1-7 Signal Conditioning . 1-10 The Computer . 1-12 Software . 1-12 i The Analog Input Subsystem . 1-15 Sampling . 1-15 Quantization . 1-19 Channel Configuration . 1-23 Transferring Data from Hardware to System Memory . 1-26 Making Quality Measurements . 1-28 Accuracy and Precision . 1-28 Noise . 1-32 Matching the Sensor Range and A/D Converter Range . 1-33 How Fast Should a Signal Be Sampled? . 1-34 Selected Bibliography . 1-38 Getting Started with the Data Acquisition Toolbox 2 Toolbox Components . 2-2 M-File Functions . 2-3 The Data Acquisition Engine . 2-4 The Hardware Driver Adaptor . 2-7 Accessing Your Hardware . 2-8 Acquiring Data . 2-8 Outputting Data . 2-9 Reading and Writing Digital Values . 2-10 Understanding the Toolbox Capabilities . 2-12 The Contents M-File . 2-12 Documentation Examples . 2-12 The Quick Reference Guide . 2-13 Demos . 2-13 Examining Your Hardware Resources . 2-17 General Toolbox Information . 2-17 Adaptor-Specific Information . 2-18 Device Object Information . 2-19 ii Contents Getting Help . 2-20 The daqhelp Function . 2-20 The propinfo Function . 2-21 The Data Acquisition Session 3 Overview . 3-2 Creating a Device Object . 3-4 Creating an Array of Device Objects . 3-5 Where Do Device Objects Exist? . 3-6 Adding Channels or Lines . 3-8 Mapping Hardware Channel IDs to MATLAB Indices . 3-9 Configuring and Returning Properties . 3-12 Property Types . 3-12 Returning Property Names and Property Values . 3-14 Configuring Property Values . 3-18 Specifying Property Names . 3-19 Default Property Values . 3-19 The Data Acquisition Property Editor . 3-20 Acquiring and Outputting Data . 3-22 Starting the Device Object . 3-23 Logging or Sending Data . 3-23 Stopping the Device Object . 3-24 Cleaning Up . 3-25 iii Getting Started with Analog Input 4 Creating an Analog Input Object . 4-2 Adding Channels to an Analog Input Object . 4-3 Referencing Individual Hardware Channels . 4-5 Example: Adding Channels for a Sound Card . 4-6 Configuring Analog Input Properties . 4-8 The Sampling Rate . 4-8 Trigger Types . 4-10 The Samples to Acquire per Trigger . 4-11 Acquiring Data . 4-12 Starting the Analog Input Object . 4-12 Logging Data . 4-13 Stopping the Analog Input Object . 4-13 Analog Input Examples . 4-14 Acquiring Data with a Sound Card . 4-14 Acquiring Data with a National Instruments Board . 4-18 Evaluating the Analog Input Object Status . 4-21 Status Properties . 4-21 The Display Summary . 4-22 Doing More with Analog Input 5 Configuring and Sampling Input Channels . 5-2 Input Channel Configuration . 5-3 Sampling Rate . 5-5 Channel Skew . 5-6 iv Contents Managing Acquired Data . 5-8 Previewing Data . 5-8 Extracting Data from the Engine . 5-12 Returning Time Information . 5-17 Configuring Analog Input Triggers . 5-19 Defining a Trigger: Trigger Types and Conditions . 5-20 Executing the Trigger . 5-25 Trigger Delays . 5-25 Repeating Triggers . 5-29 How Many Triggers Occurred? . 5-35.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages584 Page
-
File Size-