advertisement
Table of
Contents
About This Manual
Organization of This Manual ........................................................................................xvii
Conventions Used in This Manual ................................................................................xviii
Related Documentation .................................................................................................xxi
Customer Communication ............................................................................................xxi
Part 1: Before You Get Started
Chapter 1
How To Use This Book
Chapter 2
Installing and Configuring Your Data Acquisition Hardware
LabVIEW Data Acquisition Hardware Support ...........................................................2-4
Installing Your National Instruments Device ...............................................................2-5
Configuring Your DAQ Device in Windows .................................................2-6
Configuring Your DAQ Device for ISA and PCMCIA Bus
Computers .......................................................................................2-6
Configuring Your DAQ Device for EISA Bus Computers ..............2-9
Configuring Plug and Play (Switchless) DAQ Devices in
Windows ...........................................................................................2-10
Configuring and Testing Your DAQ Devices with WDAQCONF in Windows .....................................................................................2-11
Special Considerations for LabVIEW for Windows NT ................................2-14
Changing I/O Page Lock Limit ........................................................2-14
User Privilege Level When Using NI-DAQ ....................................2-15
Configuring Your DAQ Device Using NI-DAQ on the Macintosh ...............2-16
Installing and Configuring Your DAQ Device in Unix ..................................2-18
Installing NI-DAQ Software in Unix ...............................................2-19
Configuring Your DAQ Device in UNIX ........................................2-19
Installing and Configuring Your SCXI Chassis in Windows or on the
Macintosh ......................................................................................................2-20
National Instruments Corporation v LabVIEW Data Acquisition Basics Manual
Table of Contents
Hardware Configuration .................................................................. 2-20
Software Configuration in Windows ............................................... 2-22
Software Configuration on the Macintosh ....................................... 2-25
Chapter 3
Basic LabVIEW Data Acquisition Concepts
Location of Common DAQ Examples ......................................................................... 3-1
Locating the Data Acquisition VIs in LabVIEW ......................................................... 3-2
DAQ VI Organization .................................................................................................. 3-4
Easy VIs ......................................................................................................... 3-5
Intermediate VIs ............................................................................................. 3-5
Utility VIs ....................................................................................................... 3-6
Advanced VIs ................................................................................................. 3-6
VI Parameter Conventions ........................................................................................... 3-6
Default and Current Value Conventions ...................................................................... 3-7
Common DAQ VI Parameters ...................................................................................... 3-7
Error Handling .............................................................................................................. 3-8
Channel, Port, and Counter Addressing ....................................................................... 3-9
Limit Settings ............................................................................................................... 3-11
Data Organization for Analog Applications ................................................................. 3-14
Chapter 4
Where You Should Go Next
Questions You Should Answer .................................................................................... 4-3
Part 2: Catching the Wave with Analog Input
Chapter 5
Things You Should Know about Analog Input
Defining Your Signal ................................................................................................... 5-1
To What Is Your Signal Referenced? ............................................................ 5-2
Grounded Signal Sources ................................................................ 5-2
Floating Signal Sources ................................................................... 5-3
Choosing Your Measurement System .......................................................................... 5-3
Resolution ...................................................................................................... 5-3
Device Voltage Range .................................................................................... 5-4
Signal Voltage Range (Limit Settings) .......................................................... 5-5
Considerations for Selecting Analog Input Settings .................................................... 5-6
Differential Measurement System .................................................................. 5-9
Referenced Single-Ended Measurement System ........................................... 5-10
LabVIEW Data Acquisition Basics Manual vi National Instruments Corporation
Table of Contents
Nonreferenced Single-Ended Measurement System ..................................... 5-11
LabVIEW and Analog Input ........................................................................................ 5-13
Channel Addressing with the AMUX-64T .................................................... 5-13
The AMUX-64T Scanning Order .................................................................. 5-14
Important Terms You Should Know ............................................................................ 5-17
Chapter 6
One-Stop Single-Point Acquisition
Single-Channel Single-Point Analog Input .................................................................. 6-1
Multiple-Channel Single-Point Analog Input .............................................................. 6-2
Using Analog Input/Output Control Loops .................................................................. 6-6
Using Software-Timed Analog I/O Control Loops ....................................... 6-6
Using Hardware-Timed Analog I/O Control Loops ...................................... 6-7
Improving Control Loop Performance ........................................................... 6-9
Chapter 7
Buffering Your Way through Waveform Acquisition
Can You Wait for Your Data? ...................................................................................... 7-1
Acquiring a Single Waveform ....................................................................... 7-2
Acquiring Multiple Waveforms ..................................................................... 7-3
Simple-Buffered Analog Input Examples .................................................................... 7-6
Simple-Buffered Analog Input with Graphing .............................................. 7-6
Simple-Buffered Analog Input with Multiple Starts ..................................... 7-7
Simple-Buffered Analog Input with a Write to Spreadsheet File .................. 7-9
Triggered Analog Input .................................................................................. 7-10
Do You Need To Access Your Data during Acquisition? ........................................... 7-10
Continuously Acquiring Data from Multiple Channels ................................. 7-11
Circular-Buffered Analog Input Examples .................................................................. 7-13
Basic Circular-Buffered Analog Input ........................................................... 7-14
Other Circular-Buffered Analog Input Examples .......................................... 7-14
Cont Acq&Chart (buffered).vi ........................................................ 7-15
Cont Acq&Graph (buffered).vi ....................................................... 7-15
Cont Acq to File (binary).vi ............................................................ 7-15
Cont Acq to File (scaled).vi ............................................................. 7-15
Cont Acq to Spreadsheet File.vi ...................................................... 7-15
Chapter 8
Controlling Your Acquisition with Triggers
Hardware Triggering .................................................................................................... 8-1
Digital Triggering .......................................................................................... 8-2
Digital Triggering Examples ........................................................... 8-3
National Instruments Corporation vii LabVIEW Data Acquisition Basics Manual
Table of Contents
Digital Triggering Examples ........................................................... 8-6
Analog Triggering .......................................................................................... 8-6
Analog Triggering Examples ........................................................... 8-7
Software Triggering ...................................................................................................... 8-10
Conditional Retrieval Examples ...................................................... 8-12
Part 3: Making Waves with Analog Output
Chapter 9
Letting an Outside Source Control Your Acquisition Rate
Externally Controlling your Channel Clock ................................................................. 9-3
Externally Controlling your Scan Clock ...................................................................... 9-5
Externally Controlling the Scan and Channel Clocks .................................................. 9-8
Chapter 10
Things You Should Know about Analog Output
Single-Point Output ...................................................................................................... 10-1
Buffered Analog Output ............................................................................................... 10-1
Chapter 11
One-Stop Single-Point Generation
Single-Immediate Updates ........................................................................................... 11-1
Multiple-Immediate Updates ........................................................................................ 11-2
Chapter 12
Buffering Your Way through Waveform Generation
Buffered Analog Output ............................................................................................... 12-1
Changing the Waveform during Generation:
Circular-Buffered Output ........................................................................................... 12-3
Eliminating Errors from Your Circular-Buffered Application ..................................... 12-5
Figure 12-5.
Circular Buffered Waveform Generation Using Intermediate VIs ..... 12-5
Part 4: Getting Square with Digital I/O
Chapter 13
Things You Should Know about Digital I/O
LabVIEW Data Acquisition Basics Manual viii National Instruments Corporation
Table of Contents
Chapter 14
When You Need It Now—Immediate Digital I/O
Chapter 15
Shaking Hands with a Digital Partner
Sending Out Multiple Digital Values ........................................................................... 15-2
Non-Buffered Handshaking ......................................................................................... 15-5
Buffered Handshaking .................................................................................................. 15-6
Simple Buffered Examples ............................................................................ 15-7
Circular-Buffered Examples .......................................................................... 15-9
Part 5: SCXI—Getting Your Signals in Great Condition
Chapter 16
Things You Should Know about SCXI
What is Signal Conditioning? ...................................................................................... 16-1
Amplification ............................................................................................................... 16-3
Isolation ........................................................................................................................ 16-4
Filtering ........................................................................................................................ 16-5
Transducer Excitation ................................................................................................... 16-5
Linearization ................................................................................................................. 16-5
Chapter 17
Hardware and Software Setup for Your SCXI System
SCXI Operating Modes ................................................................................................ 17-3
Multiplexed Mode for Analog Input Modules ............................................... 17-4
(Windows) Multiplexed Mode for the SCXI-1200 ......................... 17-4
Multiplexed Mode for Analog Output Modules .............................. 17-4
Multiplexed Mode for Digital and Relay Modules ........................................ 17-5
Parallel Mode for Analog Input Modules ...................................................... 17-5
(Windows) Parallel Mode for the SCXI-1200 ................................ 17-6
(Macintosh and Windows) Parallel Mode for Digital Modules ................... 17-6
SCXI Software Installation and Configuration ............................................................ 17-6
Chapter 18
Special Programming Considerations for SCXI
SCXI Channel Addressing ........................................................................................... 18-1
SCXI Gains .................................................................................................................. 18-2
SCXI Settling Time ........................................................................................ 18-5
National Instruments Corporation ix LabVIEW Data Acquisition Basics Manual
Table of Contents
Chapter 19
Common SCXI Applications
Analog Input Applications for Measuring Temperature .............................................. 19-2
Measuring Temperature with Thermocouples ............................................... 19-2
Temperature Sensors for Cold-Junction Compensation .................. 19-3
Amplifier Offset ............................................................................... 19-4
VI Examples ................................................................................................................. 19-5
Measuring Temperature with RTDs ............................................................................. 19-9
Measuring Pressure with Strain Gauges ....................................................................... 19-11
Analog Output Application Example ........................................................................... 19-14
Digital Input Application Example .............................................................................. 19-15
Digital Output Application Example ............................................................................ 19-17
Multi-Chassis Applications .......................................................................................... 19-18
Chapter 20
SCXI Calibration—Increasing Signal Measurement Precision
EEPROM—Your System’s Holding Tank for
Calibration Constants ................................................................................................. 20-1
Calibrating SCXI Modules ........................................................................................... 20-3
SCXI Calibration Methods for Signal Acquisition ........................................ 20-4
One-Point Calibration ...................................................................... 20-5
Two-Point Calibration ..................................................................... 20-6
Calibrating SCXI Modules for Signal Generation ......................................... 20-7
Part 6: Counting Your Way to High-Precision Timing
Chapter 21
Things You Should Know about Counters
Knowing the Parts of Your Counter ............................................................................. 21-2
Knowing Your Counter Chip ....................................................................................... 21-4
Counting Operations When All Your Counters Are Used ........................................... 21-5
Chapter 22
Generating A Square Pulse or Pulse Trains
Generating a Square Pulse ............................................................................................ 22-1
Generating a Single Square Pulse ................................................................................. 22-3
Generating a Pulse Train .............................................................................................. 22-5
Generating a Continuous Pulse Train ............................................................ 22-5
Generating a Finite Pulse Train ...................................................................... 22-7
LabVIEW Data Acquisition Basics Manual x National Instruments Corporation
Table of Contents
Knowing the Accuracy of Your Counters .................................................................... 22-9
Stopping Counter Generations ..................................................................................... 22-9
Chapter 23
Measuring Pulse Width
Measuring a Pulse Width ............................................................................................. 23-1
Determining Pulse Width ............................................................................................. 23-2
Controlling Your Pulse Width Measurement ............................................................... 23-3
Increasing Your Measurable Width Range .................................................................. 23-4
Chapter 24
Measuring Frequency and Period
Knowing How and When to Measure Frequency and Period ...................................... 24-1
Connecting Counters to Measure Frequency and Period ............................................. 24-2
Measuring the Frequency and Period of Low Frequency Signals ................................ 24-4
Measuring the Frequency and Period of High Frequency Signals ............................... 24-5
Chapter 25
Counting Signal Highs and Lows
Counting Events or Elapsed Time ................................................................................ 25-3
Gaining More Control over Your Counting Operations .............................................. 25-5
Chapter 26
Dividing Frequencies
Part 7: Debugging Your Data Acquisition Application
Chapter 27
Debugging Techniques
Hardware Connection Errors ........................................................................................ 27-1
Software Configuration Errors ..................................................................................... 27-1
VI Construction Errors ................................................................................................. 27-2
Error Handling ............................................................................................... 27-2
Single-Stepping through a VI ........................................................................ 27-3
Execution Highlighting .................................................................................. 27-3
Using the Probe Tool ..................................................................................... 27-4
Setting Breakpoints and Showing Advanced DAQ VIs ................................ 27-4
National Instruments Corporation xi LabVIEW Data Acquisition Basics Manual
Table of Contents
Appendix A
LabVIEW Data Acquisition Common Questions
Appendix B
Customer Communication
Figures
Figure 2-1.
Figure 2-2.
Figure 2-3.
Figure 2-4.
Installing and Configuring DAQ Devices .......................................... 2-2
How NI-DAQ Relates to Your System and DAQ Devices ................ 2-3
Locating WDAQConf in Windows ..................................................... 2-6
NI-DAQ Configuration Utility Window ............................................ 2-7
Figure 2-5.
Figure 2-6.
Device Number N Window ................................................................ 2-8
Device Configuration Window in WDAQCONF on an ISA Bus
Figure 2-7.
Figure 2-8.
Figure 2-9.
Computer ............................................................................................ 2-12
Hardware Configuration Window in WDAQCONF .......................... 2-13
NI-DAQ Device Window Listing ...................................................... 2-16
Accessing the Device Configuration Window in NI-DAQ ................ 2-17
Figure 2-10.
Device Configuration and I/O Connector Windows in NI-DAQ ....... 2-18
Figure 2-11.
SCXI Configuration Window in WDAQCONF .................................... 2-22
Figure 2-12.
SCXI Module Configuration Window in WDAQCONF ....................... 2-23
Figure 2-13.
Accessing the NI-DAQ SCXI Configuration Window on the
Macintosh ........................................................................................... 2-26
Figure 2-14.
SCXI Configuration Window in NI-DAQ ......................................... 2-26
Figure 3-1.
Figure 3-2.
Figure 3-3.
Figure 3-4.
Figure 3-5.
Accessing the Data Acquisition Palette .............................................. 3-3
Data Acquisition Palette Description ................................................. 3-4
Analog Input VI Palette Organization ................................................ 3-5
LabVIEW Help Window Conventions for the Al Single VI .............. 3-7
Figure 3-6.
Figure 3-7.
Figure 3-8.
Figure 3-9.
The Error In Input and Error Out Output Error Clusters in
LabVIEW ........................................................................................... 3-9
Limit Settings, Case 1 ......................................................................... 3-12
Limit Settings, Case 2 ......................................................................... 3-13
Example of a Basic 2D Array ............................................................. 3-14
2D Array in Row Major Order ........................................................... 3-15
Figure 3-10.
2D Array in Column Major Order ...................................................... 3-15
Figure 3-11.
Extracting a Single Channel from a Column Major 2D Array ........... 3-16
Figure 3-12.
Analog Output Buffer 2D Array ......................................................... 3-16
Figure 5-1.
Figure 5-2.
Figure 5-3.
Types of Analog Signals .................................................................... 5-1
Grounded Signal Sources ................................................................... 5-2
Floating Signal Sources ...................................................................... 5-3
LabVIEW Data Acquisition Basics Manual xii National Instruments Corporation
Table of Contents
Figure 5-4.
Figure 5-5.
Figure 5-6.
Figure 5-7.
The Effects of Resolution on ADC Precision .................................... 5-4
The Effects of Range on ADC Precision ............................................ 5-5
The Effects of Limit Settings on ADC Precision ............................... 5-6
8-Channel Differential Measurement System .................................... 5-9
Figure 5-8.
Figure 5-9.
Common-Mode Voltage ..................................................................... 5-10
16-Channel RSE Measurement System ............................................. 5-11
Figure 5-10.
16-Channel NRSE Measurement System ........................................... 5-12
Figure 6-1.
Figure 6-2.
Figure 6-3.
Figure 6-4.
Figure 6-5.
Figure 6-6.
Figure 6-7.
Figure 6-8.
The AI Sample Channel VI Help Window ........................................ 6-1
Acquiring Data Using the AI Sample Channel VI ............................. 6-2
Acquiring a Voltage from Multiple Channels with the AI Sample
Channels VI ........................................................................................ 6-3
The AI Single Scan VI Help Diagram ................................................ 6-4
Using the Intermediate VIs for a Basic Non-Buffered
Application ......................................................................................... 6-4
The Cont Acq&Chart (immediate) VI Block Diagram ...................... 6-5
Software-Timed Analog I/O ............................................................... 6-7
Analog IO Control Loop (hw timed) VI Block Diagram ................... 6-8
Figure 7-1.
Figure 7-2.
Figure 7-3.
Figure 7-4.
Figure 7-5.
Figure 7-6.
Figure 7-7.
Figure 7-8.
How Buffers Work ............................................................................. 7-2
The AI Acquire Waveform VI ........................................................... 7-3
The AI Acquire Waveforms VI .......................................................... 7-3
Using the AI Waveform Scan VI to Acquire Multiple
Waveforms ......................................................................................... 7-4
Using the Intermediate VIs to Acquire Multiple Waveforms ............ 7-5
Simple Buffered Analog Input Example ............................................ 7-6
Simple Buffered Analog Input with Graphing ................................... 7-7
Figure 7-9.
Taking a Specified Number of Samples with the AI Waveform
Scan VI ............................................................................................... 7-8
Controlling the Sampling Rate in a Simple Buffered
Acquisition ......................................................................................... 7-9
Figure 7-10.
Writing to a Spreadsheet File after Acquisition ................................. 7-10
Figure 7-11.
How a Circular Buffer Works ............................................................ 7-11
Figure 7-12.
Continuously Acquiring Data with the AI Continuous Scan VI ........ 7-12
Figure 7-13.
Using Intermediate VIs to Continuously Acquire Time-Sampled
Data .................................................................................................... 7-13
Figure 7-14.
Basic Circular-Buffered Analog Input Using the
Intermediate VIs ................................................................................. 7-14
Figure 8-1.
Figure 8-2.
Figure 8-3.
Figure 8-4.
Diagram of a Digital Trigger .............................................................. 8-2
Digital Triggering with Your DAQ Device ....................................... 8-3
Block Diagram of the Acquire N Scans-DTrig VI ............................. 8-4
Diagram of an Analog Trigger ........................................................... 8-6
National Instruments Corporation xiii LabVIEW Data Acquisition Basics Manual
Table of Contents
Figure 8-5.
Figure 8-6.
Figure 8-7.
Figure 8-8.
Figure 8-9.
Figure 9-1.
Figure 9-2.
Figure 9-3.
Figure 9-4.
Figure 9-5.
Figure 9-6.
Figure 9-7.
Analog Triggering with Your DAQ Device ....................................... 8-7
Block Diagram of the Acquire N Scans-ATrig VI ............................. 8-8
Timeline of Conditional Retrieval ...................................................... 8-11
The AI Read VI Conditional Retrieval Cluster .................................. 8-12
Block Diagram of the Acquire N Scans-ATrig VI ............................. 8-13
Channel and Scan Intervals Using the Channel Clock ....................... 9-2
Round-Robin Scanning Using the Channel Clock ............................. 9-2
Example of a TTL Signal ................................................................... 9-3
Getting Started Analog Input Example VI ......................................... 9-4
Setting the Clock Source Code for External Conversion Pulses for E Series Devices ........................................................................... 9-5
Externally Controlling Your Scan Clock with the Getting Started
Analog Input Example VI ................................................................... 9-7
Controlling the Scan and Channel Clock Simultaneously ................. 9-8
Figure 11-1.
Single Immediate Update Using the AO Update Channels VI .......... 11-1
Figure 11-2.
Single Immediate Update Using Intermediate VI .............................. 11-2
Figure 11-3.
Multiple Immediate Updates Using Intermediate VI ......................... 11-3
Figure 12-1.
Waveform Generation Using the AO Generate Waveforms VI ......... 12-1
Figure 12-2.
Waveform Generation Using the AO Waveform Gen VI .................. 12-2
Figure 12-3.
Waveform Generation Using Intermediate VIs .................................. 12-3
Figure 12-4.
Circular Buffered Waveform Generation Using the AO
Continuous Gen VI ............................................................................. 12-4
Figure 12-5.
Circular Buffered Waveform Generation Using Intermediate VIs ..... 12-5
Figure 13-1.
Digital Ports and Lines ....................................................................... 13-1
Figure 14-1.
The Easy Digital VIs .......................................................................... 14-2
Figure 15-1.
Connecting Signal Lines for Digital Input ......................................... 15-3
Figure 15-2.
Connecting Digital Signal Lines for Digital Output ........................... 15-4
Figure 15-3.
Non-buffered Handshaking Using the DIO Single Read/Write VI..... 15-5
Figure 15-4.
Non-buffered Handshaking Using the DIO Single Read/Write VI..... 15-6
Figure 15-5.
Pattern Generation Using the DIO-32F Devices ................................ 15-7
Figure 15-6.
Pattern Generation Using DAQ Devices (Other Than DIO-32F
Devices) .............................................................................................. 15-8
Figure 15-7.
Reading Data with the Digital VIs Using Digital Handshaking
(DIO-32F Devices) ............................................................................. 15-8
Figure 15-8.
Reading Data with the Digital VIs Using Digital Handshaking ......... 15-9
Figure 15-9.
Digital Handshaking Using a Circular Buffer .................................... 15-10
LabVIEW Data Acquisition Basics Manual xiv National Instruments Corporation
Table of Contents
Figure 16-1.
Common Types of Transducers/Signals and Signal Conditioning .... 16-3
Figure 16-2.
Amplifying Signals Near the Source to Increase Signal-to-Noise
Ratio ................................................................................................... 16-4
Figure 17-1.
SCXI System ...................................................................................... 17-1
Figure 17-2.
Components of an SCXI System ........................................................ 17-2
Figure 17-3.
SCXI Chassis ...................................................................................... 17-3
Figure 19-1.
Measuring a Single Module with the Acquire and Average VI ......... 19-6
Figure 19-2.
Measuring Temperature Sensors Using the Acquire and
Average VI ......................................................................................... 19-7
Figure 19-3.
Continuously Acquiring Data Using Intermediate VIs ...................... 19-8
Figure 19-4.
Half-Bridge Strain Gauge ................................................................... 19-12
Figure 21-1.
CTR Control VI Front Panel and Block Diagram .............................. 21-5
Figure 22-1.
Pulse Created with Positive Polarity and Toggled Output ................. 22-2
Figure 22-2.
Pulse Duty Cycles .............................................................................. 22-3
Figure 22-3.
Physical Connections for Generating a Square Pulse ........................ 22-4
Figure 22-4.
Using the Generate Delayed Pulse VI ................................................ 22-4
Figure 22-5.
Generating a Single Delayed Pulse Using Intermediate Vis .............. 22-5
Figure 22-6.
Physical Connections for Generating a Square Pulse ........................ 22-6
Figure 22-7.
Generating a Continuous Pulse Train with the Generate Pulse
Train VI .............................................................................................. 22-6
Figure 22-8.
Generating a Continuous Pulse Train Using Intermediate VIs .......... 22-7
Figure 22-9.
Physical Connections for Generating a Finite Pulse Train ................. 22-8
Figure 22-10.
Creating a Finite Pulse Train Using the Intermediate VIs ................. 22-8
Figure 22-11.
Uncertainty of One Timebase Period ................................................. 22-9
Figure 22-12.
Using the Generate Delayed Pulse and Stopping the Counting
Operation ............................................................................................ 22-10
Figure 22-13.
Stopping a Generated Pulse Train ...................................................... 22-10
Figure 23-1.
Counting Input Signals to Determine Pulse Width ............................ 23-1
Figure 23-2.
Physical Connections for Determining Pulse Width .......................... 23-2
Figure 23-3.
Determining Pulse Width Using the Pulse Width or Period VI ......... 23-2
Figure 23-4.
Measuring Pulse Width Using Intermediate VIs ................................ 23-3
Figure 24-1.
Measuring Square Wave Frequency ................................................... 24-1
Figure 24-2.
Measuring a Square Wave Period ...................................................... 24-2
Figure 24-3.
Physical Connections for Period Measurement of Low Frequency
Signals ................................................................................................ 24-3
Figure 24-4.
Physical Connections for Period Measurement of High Frequency
Signals ................................................................................................ 24-3
National Instruments Corporation xv LabVIEW Data Acquisition Basics Manual
Table of Contents
Figure 24-5.
Measuring Low-Frequency Signals with Measure Pulse Width or
Period VI ............................................................................................ 24-4
Figure 24-6.
Measuring Low-Frequency Signals Using Intermediate VIs ............. 24-5
Figure 24-7.
Measure Frequency VI ....................................................................... 24-6
Figure 24-8.
Measuring High-Frequency Signals Using Intermediate VIs ............ 24-6
Figure 25-1.
Connecting Counters to Your Device to Count Events or Time ........ 25-1
Figure 25-2.
Using the Count Events or Time VI to Count External Events .......... 25-3
Figure 25-3.
Using the Count Events or Time VI to Measure Elapsed Time ......... 25-4
Figure 25-4.
Using the Intermediate VIs to Count External Events ....................... 25-5
Figure 25-5.
Using the Intermediate VIs to Measure Elapsed Time ....................... 25-6
Figure 26-1.
Wiring Your Counters for Frequency Division .................................. 26-1
Figure 26-2.
Programming a Single Divider for Frequency Division ..................... 26-2
Figure 27-1.
Error Checking Using the General Error Handler VI ......................... 27-3
Figure 27-2.
Error Checking Using the Simple Error Handler VI .......................... 27-3
Tables
Table 2-1.
Table 2-2.
LabVIEW DAQ Hardware Support for Windows .............................. 2-4
LabVIEW DAQ Hardware Support for Macintosh ............................. 2-5
Table 5-1.
Table 5-2.
Table 5-3.
Table 5-4.
Measurement Precision for Various Device Ranges and Limit
Settings ................................................................................................. 5-8
Analog Input Channel Range .............................................................. 5-13
Scanning Order for Each DAQ Device Input Channel with Four
AMUX-64Ts ....................................................................................... 5-15
Scanning Order for Each DAQ Device Input Channel with Four
AMUX-64Ts ....................................................................................... 5-16
Table 9-1.
External Scan Clock Input Pins ........................................................... 9-6
Table 16-1.
Phenomena and Transducers ............................................................... 16-1
Table 18-1.
SCXI-1100 Channel Arrays, Input Limits Arrays, and Gains ............ 18-4
Table 25-1.
Adjacent Counters for Counter Chips ................................................. 25-2
LabVIEW Data Acquisition Basics Manual xvi National Instruments Corporation
advertisement
Related manuals
advertisement
Table of contents
- 1 LabVIEW Data Acquisition Basics Manual
- 2 Support
- 3 Important Information
- 3 Warranty
- 3 Copyright
- 3 Trademarks
- 3 Warning
- 4 Table of Contents
- 16 About This Manual
- 16 Organization of This Manual
- 17 Conventions Used in This Manual
- 20 Related Documentation
- 20 Customer Communication
- 21 Part 1 Before You Get Started
- 22 Chapter 1 How To Use This Book
- 25 Chapter 2 Installing and Configuring Your Data Acquisition Hardware 2
- 28 LabVIEW Data Acquisition Hardware Support
- 29 Installing Your National Instruments Device
- 30 Configuring Your DAQ Device in Windows
- 38 Special Considerations for LabVIEW for Windows NT
- 40 Configuring Your DAQ Device Using NI-DAQ on the Macintosh
- 42 Installing and Configuring Your DAQ Device in Unix
- 44 Installing and Configuring Your SCXI Chassis in Windows or on the Macintosh
- 53 Chapter 3 Basic LabVIEW Data Acquisition Concepts
- 53 Location of Common DAQ Examples
- 54 Locating the Data Acquisition VIs in LabVIEW
- 56 DAQ VI Organization
- 58 VI Parameter Conventions
- 59 Default and Current Value Conventions
- 59 Common DAQ VI Parameters
- 60 Error Handling
- 61 Channel,Port,and Counter Addressing
- 63 Limit Settings
- 66 Data Organization for Analog Applications
- 69 Chapter 4 Where You Should Go Next
- 71 Questions You Should Answer
- 74 Part 2 Catching the Wave with Analog Input 2
- 75 Chapter 5 Things You Should Know about Analog Input
- 75 Defining Your Signal
- 76 To What Is Your Signal Referenced?
- 77 Choosing Your Measurement System
- 77 Resolution
- 78 Device Voltage Range
- 79 Signal Voltage Range (Limit Settings)
- 80 Considerations for Selecting Analog Input Settings
- 83 Differential Measurement System
- 84 Referenced Single-Ended Measurement System
- 85 Nonreferenced Single-Ended Measurement System
- 87 LabVIEW and Analog Input
- 87 Channel Addressing with the AMUX-64T
- 88 The AMUX-64T Scanning Order
- 91 Important Terms You Should Know
- 93 Chapter 6 One-Stop Single-Point Acquisition
- 93 Single-Channel Single-Point Analog Input
- 94 Multiple-Channel Single-Point Analog Input
- 98 Using Analog Input/Output Control Loops
- 98 Using Software-Timed Analog I/O Control Loops
- 99 Using Hardware-Timed Analog I/O Control Loops
- 101 Improving Control Loop Performance
- 103 Chapter 7 Buffering Your Way through Waveform Acquisition
- 103 Can You Wait for Your Data?
- 104 Acquiring a Single Waveform
- 105 Acquiring Multiple Waveforms
- 108 Simple-Buffered Analog Input Examples
- 108 Simple-Buffered Analog Input with Graphing
- 109 Simple-Buffered Analog Input with Multiple Starts
- 111 Simple-Buffered Analog Input with a Write to Spreadsheet File
- 112 Triggered Analog Input
- 112 Do You Need To Access Your Data during Acquisition?
- 113 Continuously Acquiring Data from Multiple Channels
- 115 Circular-Buffered Analog Input Examples
- 116 Basic Circular-Buffered Analog Input
- 116 Other Circular-Buffered Analog Input Examples
- 118 Chapter 8 Controlling Your Acquisition with Triggers
- 118 Hardware Triggering
- 119 Digital Triggering
- 123 Analog Triggering
- 127 Software Triggering
- 132 Chapter 9 Letting an Outside Source Control Your Acquisition Rate
- 134 Externally Controlling your Channel Clock
- 136 Externally Controlling your Scan Clock
- 139 Externally Controlling the Scan and Channel Clocks
- 140 Part 3 Making Waves with Analog Output
- 141 Chapter 10 Things You Should Know about Analog Output
- 141 Single-Point Output
- 141 Buffered Analog Output
- 143 Chapter 11 One-Stop Single-Point Generation
- 143 Single-Immediate Updates
- 144 Multiple-Immediate Updates
- 146 Chapter 12 Buffering Your Way through Waveform Generation
- 146 Buffered Analog Output
- 148 Changing the Waveform during Generation: Circular-Buffered Output
- 150 Eliminating Errors from Your Circular-Buffered Application
- 151 Part 4 Getting Square with Digital I/O
- 152 Chapter 13 Things You Should Know about Digital I/O
- 154 Chapter 14 When You Need It Now — Immediate Digital I/O
- 157 Chapter 15 Shaking Hands with a Digital Partner
- 158 Sending Out Multiple Digital Values
- 161 Non-Buffered Handshaking
- 162 Buffered Handshaking
- 163 Simple Buffered Examples
- 165 Circular-Buffered Examples
- 167 Part 5 SCXI —Getting Your Signals in Great Condition
- 168 Chapter 16 Things You Should Know about SCXI
- 168 What is Signal Conditioning?
- 170 Amplification
- 171 Isolation
- 172 Filtering
- 172 Transducer Excitation
- 172 Linearization
- 173 Chapter 17 Hardware and Software Setup for Your SCXI System
- 175 SCXI Operating Modes
- 176 Multiplexed Mode for Analog Input Modules
- 177 Multiplexed Mode for Digital and Relay Modules
- 177 Parallel Mode for Analog Input Modules
- 178 SCXI Software Installation and Configuration
- 179 Chapter 18 Special Programming Considerations for SCXI
- 179 SCXI Channel Addressing
- 180 SCXI Gains
- 183 SCXI Settling Time
- 184 Chapter 19 Common SCXI Applications
- 185 Analog Input Applications for Measuring Temperature
- 185 Measuring Temperature with Thermocouples
- 188 VI Examples
- 192 Measuring Temperature with RTDs
- 194 Measuring Pressure with Strain Gauges
- 197 Analog Output Application Example
- 198 Digital Input Application Example
- 200 Digital Output Application Example
- 201 Multi-Chassis Applications
- 203 Chapter 20 SCXI Calibration—Increasing Signal Measurement Precision
- 203 EEPROM —Your System ’s Holding Tank for Calibration Constants
- 205 Calibrating SCXI Modules
- 206 SCXI Calibration Methods for Signal Acquisition
- 209 Calibrating SCXI Modules for Signal Generation
- 211 Part 6 Want Precision Timing —Use Counters
- 212 Chapter 21 Things You Should Know about Counters
- 213 Knowing the Parts of Your Counter
- 215 Knowing Your Counter Chip
- 216 Counting Operations When All Your Counters Are Used
- 217 Chapter 22 Generating A Square Pulse or Pulse Trains
- 217 Generating a Square Pulse
- 219 Generating a Single Square Pulse
- 221 Generating a Pulse Train
- 221 Generating a Continuous Pulse Train
- 223 Generating a Finite Pulse Train
- 225 Knowing the Accuracy of Your Counters
- 225 Stopping Counter Generations
- 227 Chapter 23 Measuring Pulse Width
- 227 Measuring a Pulse Width
- 228 Determining Pulse Width
- 229 Controlling Your Pulse Width Measurement
- 230 Increasing Your Measurable Width Range
- 231 Chapter 24 Measuring Frequency and Period
- 231 Knowing How and When to Measure Frequency and Period
- 232 Connecting Counters to Measure Frequency and Period
- 234 Measuring the Frequency and Period of Low Frequency Signals
- 235 Measuring the Frequency and Period of High Frequency Signals
- 238 Chapter 25 Counting Signal Highs and Lows
- 240 Counting Events or Elapsed Time
- 242 Gaining More Control over Your Counting Operations
- 245 Chapter 26 Dividing Frequencies
- 248 Part 7 Debugging Your Data Acquisition Application
- 249 Chapter 27 Debugging Techniques
- 249 Hardware Connection Errors
- 249 Software Configuration Errors
- 250 VI Construction Errors
- 250 Error Handling
- 251 Single-Stepping through a VI
- 251 Execution Highlighting
- 252 Using the Probe Tool
- 252 Setting Breakpoints and Showing Advanced DAQ VIs
- 253 Appendix A LabVIEW Data Acquisition Common Questions
- 258 Appendix B Customer Communication
- 258 Electronic Services
- 259 Telephone and Fax Support
- 260 Technical Support Form
- 261 Documentation Comment Form
- 262 Glossary
- 262 Numbers/Symbols
- 262 A
- 264 B-C
- 265 D
- 267 E-F
- 268 G-H
- 269 I
- 270 K-M
- 271 N
- 272 O-P
- 273 R
- 274 S
- 276 T
- 277 U-V
- 278 W
- 279 Index
- 279 A
- 282 B-C
- 284 D
- 286 E-F
- 287 G-H
- 288 I
- 289 J-M
- 290 N-P
- 291 Q-S
- 293 T
- 294 U-W
- 11 Figures
- 26 Figure 2-1.Installing and Configuring DAQ Devices
- 27 Figure 2-2.How NI-DAQ Relates to Your System and DAQ Devices
- 30 Figure 2-3.Locating WDAQConf in Windows
- 31 Figure 2-4.NI-DAQ Configuration Utility Window
- 32 Figure 2-5.Device Number N Window
- 36 Figure 2-6.Device Configuration Window in WDAQCONF on an ISA Bus Computer
- 37 Figure 2-7.Hardware Configuration Window in WDAQCONF
- 40 Figure 2-8.NI-DAQ Device Window Listing
- 41 Figure 2-9.Accessing the Device Configuration Window in NI-DAQ
- 42 Figure 2-10.Device Configuration and I/O Connector Windows in NI-DAQ
- 46 Figure 2-11.SCXI Configuration Window in WDAQCONF
- 47 Figure 2-12.SCXI Module Configuration Window in WDAQCONF
- 50 Figure 2-13.Accessing the NI-DAQ SCXI Configuration Window on the Macintosh
- 50 Figure 2-14.SCXI Configuration Window in NI-DAQ
- 55 Figure 3-1.Accessing the Data Acquisition Palette
- 56 Figure 3-2.Data Acquisition Palette Description
- 57 Figure 3-3.Analog Input VI Palette Organization
- 59 Figure 3-4.LabVIEW Help Window Conventions for the Al Single VI
- 61 Figure 3-5.The Error In Input and Error Out Output Error Clusters in LabVIEW
- 64 Figure 3-6.Limit Settings,Case 1
- 65 Figure 3-7.Limit Settings,Case 2
- 66 Figure 3-8.Example of a Basic 2D Array
- 67 Figure 3-9.2D Array in Row Major Order
- 67 Figure 3-10.2D Array in Column Major Order
- 68 Figure 3-11.Extracting a Single Channel from a Column Major 2D Array
- 68 Figure 3-12.Analog Output Buffer 2D Array
- 75 Figure 5-1.Types of Analog Signals
- 76 Figure 5-2.Grounded Signal Sources
- 77 Figure 5-3.Floating Signal Sources
- 78 Figure 5-4.The Effects of Resolution on ADC Precision
- 79 Figure 5-5.The Effects of Range on ADC Precision
- 80 Figure 5-6.The Effects of Limit Settings on ADC Precision
- 83 Figure 5-7.8-Channel Differential Measurement System
- 85 Figure 5-9.16-Channel RSE Measurement System
- 86 Figure 5-10.16-Channel NRSE Measurement System
- 93 Figure 6-1.The AI Sample Channel VI Help Window
- 94 Figure 6-2.Acquiring Data Using the AI Sample Channel VI
- 95 Figure 6-3.Acquiring a Voltage from Multiple Channels with the AI Sample Channels VI
- 96 Figure 6-4.The AI Single Scan VI Help Diagram
- 96 Figure 6-5.Using the Intermediate VIs for a Basic Non-Buffered Application
- 97 Figure 6-6.The Cont Acq&Chart (immediate)VI Block Diagram
- 99 Figure 6-7.Software-Timed Analog I/O
- 100 Figure 6-8.Analog IO Control Loop (hw timed)VI Block Diagram
- 104 Figure 7-1.How Buffers Work
- 105 Figure 7-2.The AI Acquire Waveform VI
- 105 Figure 7-3.The AI Acquire Waveforms VI
- 106 Figure 7-4.Using the AI Waveform Scan VI to Acquire Multiple Waveforms
- 107 Figure 7-5.Using the Intermediate VIs to Acquire Multiple Waveforms
- 108 Figure 7-6.Simple Buffered Analog Input Example
- 109 Figure 7-7.Simple Buffered Analog Input with Graphing
- 110 Figure 7-8.Taking a Specified Number of Samples with the AI Waveform Scan VI
- 111 Figure 7-9.Controlling the Sampling Rate in a Simple Buffered Acquisition
- 112 Figure 7-10.Writing to a Spreadsheet File after Acquisition
- 113 Figure 7-11.How a Circular Buffer Works
- 114 Figure 7-12.Continuously Acquiring Data with the AI Continuous Scan VI
- 115 Figure 7-13.Using Intermediate VIs to Continuously Acquire Time-Sampled Data
- 116 Figure 7-14.Basic Circular-Buffered Analog Input Using the Intermediate VIs
- 119 Figure 8-1.Diagram of a Digital Trigger
- 120 Figure 8-2.Digital Triggering with Your DAQ Device
- 121 Figure 8-3.Block Diagram of the Acquire N Scans-DTrig VI
- 123 Figure 8-4.Diagram of an Analog Trigger
- 124 Figure 8-5.Analog Triggering with Your DAQ Device
- 125 Figure 8-6.Block Diagram of the Acquire N Scans-ATrig VI
- 128 Figure 8-7.Timeline of Conditional Retrieval
- 129 Figure 8-8.The AI Read VI Conditional Retrieval Cluster
- 130 Figure 8-9.Block Diagram of the Acquire N Scans-ATrig VI
- 133 Figure 9-1.Channel and Scan Intervals Using the Channel Clock
- 133 Figure 9-2.Round-Robin Scanning Using the Channel Clock
- 134 Figure 9-3.Example of a TTL Signal
- 135 Figure 9-4.Getting Started Analog Input Example VI
- 136 Figure 9-5.Setting the Clock Source Code for External Conversion Pulses for E Series Devices
- 138 Figure 9-6.Externally Controlling Your Scan Clock with the Getting Started Analog Input Example VI
- 139 Figure 9-7.Controlling the Scan and Channel Clock Simultaneously
- 143 Figure 11-1.Single Immediate Update Using the AO Update Channels VI
- 144 Figure 11-2.Single Immediate Update Using Intermediate VI
- 145 Figure 11-3.Multiple Immediate Updates Using Intermediate VI
- 146 Figure 12-1.Waveform Generation Using the AO Generate Waveforms VI
- 147 Figure 12-2.Waveform Generation Using the AO Waveform Gen VI
- 148 Figure 12-3.Waveform Generation Using Intermediate VIs
- 149 Figure 12-4.Circular Buffered Waveform Generation Using the AO Continuous Gen VI
- 150 Figure 12-5.Circular Buffered Waveform Generation Using Intermediate VIs
- 152 Figure 13-1.Digital Ports and Lines
- 155 Figure 14-1.The Easy Digital VIs
- 159 Figure 15-1.Connecting Signal Lines for Digital Input
- 160 Figure 15-2.Connecting Digital Signal Lines for Digital Output
- 161 Figure 15-3.Non-buffered Handshaking Using the DIO Single Read/Write VI
- 162 Figure 15-4.Non-buffered Handshaking Using the DIO Single Read/Write VI
- 163 Figure 15-5.Pattern Generation Using the DIO-32F Devices
- 164 Figure 15-6.Pattern Generation Using DAQ Devices (Other Than DIO-32F Devices)
- 164 Figure 15-7.Reading Data with the Digital VIs Using Digital Handshaking (DIO-32F Devices)
- 165 Figure 15-8.Reading Data with the Digital VIs Using Digital Handshaking
- 166 Figure 15-9.Digital Handshaking Using a Circular Buffer
- 170 Figure 16-1.Common Types of Transducers/Signals and Signal Conditioning
- 171 Figure 16-2.Amplifying Signals Near the Source to Increase Signal-to-Noise Ratio
- 173 Figure 17-1.SCXI System
- 174 Figure 17-2.Components of an SCXI System
- 175 Figure 17-3.SCXI Chassis
- 189 Figure 19-1.Measuring a Single Module with the Acquire and Average VI
- 190 Figure 19-2.Measuring Temperature Sensors Using the Acquire and Average VI
- 191 Figure 19-3.Continuously Acquiring Data Using Intermediate VIs
- 195 Figure 19-4.Half-Bridge Strain Gauge
- 216 Figure 21-1.CTR Control VI Front Panel and Block Diagram
- 218 Figure 22-1.Pulse Created with Positive Polarity and Toggled Output
- 219 Figure 22-2.Pulse Duty Cycles
- 220 Figure 22-3.Physical Connections for Generating a Square Pulse
- 220 Figure 22-4.Using the Generate Delayed Pulse VI
- 222 Figure 22-6.Physical Connections for Generating a Square Pulse
- 222 Figure 22-7.Generating a Continuous Pulse Train with the Generate Pulse Train VI
- 223 Figure 22-8.Generating a Continuous Pulse Train Using Intermediate VIs
- 224 Figure 22-9.Physical Connections for Generating a Finite Pulse Train
- 224 Figure 22-10.Creating a Finite Pulse Train Using the Intermediate VIs
- 225 Figure 22-11.Uncertainty of One Timebase Period
- 226 Figure 22-12.Using the Generate Delayed Pulse and Stopping the Counting Operation
- 226 Figure 22-13.Stopping a Generated Pulse Train
- 227 Figure 23-1.Counting Input Signals to Determine Pulse Width
- 228 Figure 23-2.Physical Connections for Determining Pulse Width
- 228 Figure 23-3.Determining Pulse Width Using the Pulse Width or Period VI
- 229 Figure 23-4.Measuring Pulse Width Using Intermediate VIs
- 231 Figure 24-1.Measuring Square Wave Frequency
- 232 Figure 24-2.Measuring a Square Wave Period
- 233 Figure 24-3.Physical Connections for Period Measurement of Low Frequency Signals
- 233 Figure 24-4.Physical Connections for Period Measurement of High Frequency Signals
- 234 Figure 24-5.Measuring Low-Frequency Signals with Measure Pulse Width or Period VI
- 235 Figure 24-6.Measuring Low-Frequency Signals Using Intermediate VIs
- 236 Figure 24-7.Measure Frequency VI
- 236 Figure 24-8.Measuring High-Frequency Signals Using Intermediate VIs
- 238 Figure 25-1.Connecting Counters to Your Device to Count Events or Time
- 240 Figure 25-2.Using the Count Events or Time VI to Count External Events
- 241 Figure 25-3.Using the Count Events or Time VI to Measure Elapsed Time
- 242 Figure 25-4.Using the Intermediate VIs to Count External Events
- 243 Figure 25-5.Using the Intermediate VIs to Measure Elapsed Time
- 245 Figure 26-1.Wiring Your Counters for Frequency Division
- 246 Figure 26-2.Programming a Single Divider for Frequency Division
- 251 Figure 27-1.Error Checking Using the General Error Handler VI
- 251 Figure 27-2.Error Checking Using the Simple Error Handler VI
- 15 Tables
- 28 Table 2-1.LabVIEW DAQ Hardware Support for Windows
- 29 Table 2-2.LabVIEW DAQ Hardware Support for Macintosh
- 82 Table 5-1.Measurement Precision for Various Device Ranges and Limit Settings
- 87 Table 5-2.Analog Input Channel Range
- 89 Table 5-3.Scanning Order for Each DAQ Device Input Channel
- 90 Table 5-4.Scanning Order for Each DAQ Device Input Channel with Four AMUX-64Ts
- 137 Table 9-1.External Scan Clock Input Pins
- 168 Table 16-1.Phenomena and Transducers
- 182 Table 18-1.SCXI-1100 Channel Arrays,Input Limits Arrays,and Gains
- 239 Table 25-1.Adjacent Counters for Counter Chips