Advanced NI-DAQmx Programming Techniques with LabVIEW

Similar documents
BE/EE189 Design and Construction of Biodevices Lecture 5. BE/EE189 Design and Construction of Biodevices - Caltech

E Series Multifunction I/O 1.25 MS/s, 12-Bit, 16 or 64 Analog Inputs

NI-DAQmx Basic Course NITS John Shannon

Data Acquisition Fundamentals

A variety of ECONseries modules provide economical yet flexible solutions. Waveform Generation

The data acquisition components, and their relationship to each other, are shown below.

DT9828. USB Powered Thermocouple Measurement Module. Key Features: Analog Input Channels

Portable E Series Multifunction DAQ 12 or 16-Bit, up to 1.25 MS/s, 16 Analog Inputs

What s New in Data Acquisition

DaqBoard/1000. Series 16-Bit, 200-kHz PCI Data Acquisition Boards

High-Speed M Series Multifunction DAQ 16-Bit, up to 1.25 MS/s, up to 80 Analog Inputs

Low Cost Multifunction I/O 100 ks/s, 12-Bit, 8 Analog Inputs

VIBBOX. 32, 48, or 64-Channel Sound & Vibration Solution Expansion to 256 Channels. Key Feature of Each VIBbox: Table 1. Key Features of VIBbox Models

Low-Cost E Series Multifunction DAQ. 12 or 16-Bit, 200 ks/s, 16 Analog Inputs

Features. RoHS COMPLIANT 2002/95/EC

PC-based data acquisition I

Data Acquisition in LabVIEW

High-Speed M Series Multifunction DAQ 16-Bit, up to 1.25 MS/s, up to 80 Analog Inputs

DT MS/s High-Speed, Isolated Simultaneous USB Data Acquisition Module. Overview. Key Features. Bandwidth of the DT9862

Building a Next Generation Data Logging System

Analog Input Sample Rate

A 40-pin connector provides access to 24 DIO connections.

Artisan Technology Group is your source for quality new and certified-used/pre-owned equipment

High-Speed Voltage Output up to 1 MS/s/Channel, up to 16-Bit, up to 32 Channels

Features. High-precision Analog input board (Low Profile size) for PCI Express AI-1616L-LPE AI-1616L-LPE 1. Ver.1.01

AIO AH-PCI. Features. Packing List. 12-bits Analog I/O Board (High Gain) for PCI AIO AH-PCI 1. Ver.1.04

High-Speed Voltage Output up to 1 MS/s/Channel, up to 16 Bits, up to 32 Channels

Temperature measurement board, optically isolated, 16/8/4 channels for thermocouples, Pt100, RTD, 18-bit

USB 1608G Series USB Multifunction Devices

Acquiring Data from Sensors and Instruments Using MATLAB

New Technologies in Data Acquisition

USB 1608G Series USB Multifunction Devices

Multifunction DAQ Accessory and Cable Selection Guides

High-Accuracy M Series Multifunction DAQ 18-Bit, up to 625 ks/s, up to 32 Analog Inputs

LabVIEW Core 1. What You Need To Get Started. File Locations. The course installer places the course files in the following location: ni.

Computerized Measurement systems

VIBbox 64-Channel Sound & Vibration Solution

LabVIEW Basics I: Introduction Course

PC104P-16AIO Bit Analog Input/Output PC104-Plus Board

Data Acquisition Specifications a Glossary Richard House

6220 Ethernet-Based Voltage Measurement Module

DT3016. High-Speed, Multifunction PCI Data Acquisition Board. Overview. Key Features. Supported Operating Systems

A variety of ECONseries modules provide economical yet flexible solutions

BTH-1208LS Wireless Multifunction DAQ Device

DATENBLATT ADA16-32/2(PCI)F. HABEN SIE FRAGEN ODER WÜNSCHEN SIE EIN INDIVIDUELLES ANGEBOT? Unser Team berät Sie gerne persönlich.

PMC-16AIO 16-Bit Analog Input/Output PMC Board With 32 Input Channels, 4 Output Channels and 16-Bit Digital I/O Port

AIO LN-USB. Features. N Series for USB Multifunction DAQ Unit (8ch AI, 2ch AO, 16ch DIO) AIO LN-USB 1. Ver.1.01

Register Map and Descriptions

LabVIEW Tutorials. T.1 Temperature Measurement and Cold Junction Compensation (CJC) LUMS School of Science and Engineering

ECONseries Low Cost USB DAQ

DAQ Hardware Overview Guide

Dept. of Electrical, Computer and Biomedical Engineering. Instrumentation for the data acquisition laboratory

NI Technical Symposium ni.com

DaqBoard/2000 Series 16-Bit, 200-kHz PCI & CompactPCI Data Acquisition Boards

16AIO Bit Analog Input/Output Board. With 16 Input Channels and 8 Output Channels

FLEXIBLE AND MODULAR PROCESSOR T11 MULTI I/O MODULES. The Heart of ADwin Pro-II. All-rounder with A/D, D/A, counters, SSI and EtherCAT

Developing Measurement and Control Applications with the LabVIEW FPGA Pioneer System

SCP for Plastics Processing

DT3000 Series. DT3000 Series. Key Features. at full rated throughput.

ECONseries Low Cost USB DAQ

PMC-12AIO. 12-Bit PMC Analog Input/Output Board

Specifications USB-1616HS

PCI-12AIO 12-Bit Analog Input/Output PCI Board

Portable Multifunction DAQ 12 or 16-Bit, up to 1.25 MS/s, up to 16 Analog Inputs

Ethernet Data Acquisition System

USB-231-OEM. Analog and Digital I/O. User's Guide. January Rev 4 Measurement Computing Corporation

DATENBLATT ADA16-8/2(LPCI)L. HABEN SIE FRAGEN ODER WÜNSCHEN SIE EIN INDIVIDUELLES ANGEBOT? Unser Team berät Sie gerne persönlich.

Developing Measurement and Analysis System using MATLAB

±500 V Isolation Protects Your Data. Sample Rate. 16 bits ±1.25 V, ±2.5 V, ±5 V, ±10 V 100 ks/s 16 2

48-Bit Isolated Digital I/O

DAQ. PCI E Series Register-Level Programmer Manual. Multifunction I/O Boards for PCI Bus Computers. PCI E Series RLPM

CompactDAQ Chassis PRODUCT FLYER CONTENTS. Цены и срок поставки уточняйте на сайте по телефону: или

Series 16-Bit, 200-kHz PCI Data Acquisition Boards. DaqBoard/2000

PC104P-16AO20 20-Channel 16-Bit High-Speed Analog Output PC104-Plus Board With 440,000 Samples per Second per Channel, and Simultaneous Clocking

DT7816 Linux Data Acquisition Real-Time High Performance ARM Module for Embedded Applications

PXI Remote Control and System Expansion

PCI-express data acquisition card DAQ0504M User Guide

12-Channel, 12-Bit PMC Analog Input/Output Board

OEMs: Contact IOtech if you require a custom version of this board with either PCI or USB

16-Bit A/D Converter (ENOB=14.1) 16-bit D/A. 16-bit D/A. Digital I/O (8/8) Counter/Timer (2)

High-Precision Data Acquisition

DAQ Accessories Selection Guide

6220 Ethernet-Based Voltage Measurement Module

PC-CARD-DAS16/12 Specifications

1. Learn about LabView software and its different components

Answers to Frequently Asked Questions about NI-DAQmx and Traditional NI-DAQ (Legacy)

AD16-16(PCI)EV. Features. High-Resolution Analog Input Board for PCI AD16-16(PCI)EV 1. Ver.1.02

Personal Daqs USB Data Acquisition Modules Models /55 & /56

16-Channel 16-Bit PMC Analog I/O Board

PC-CARD-DAS16/16 Specifications

16AIO 16-Bit Analog Input/Output Board With 32 Input Channels, 4 Output Channels and 16-Bit Digital I/O Port

A Review of PC-Based Data Logging and Recording

NI CompactDAQ USB Data Acquisition Systems

AD12-16(PCI)EV. Features. Analog Input Board for PCI AD12-16(PCI)EV 1. Ver.1.02

Install the Software and Hardware

CompuScope Ultra-fast waveform digitizer card for PCI bus. APPLICATIONS. We offer the widest range of

S Series Multifunction DAQ 16-Bit, 800 ks/s, 4 Analog Inputs

EDX-10 Series. Compact Recording System

Chapter 1 Introducing the OM-USB-1608FS-Plus... 6 Functional block diagram... 6

32-CHANNEL 16-BIT TRANSDUCER INPUT PMC

Transcription:

Advanced NI-DAQmx Programming Techniques with LabVIEW

Agenda Understanding Your Hardware Data Acquisition Systems Data Acquisition Device Subsystems Advanced Programming with NI-DAQmx Understanding Your Timing Engine Multiple Device Synchronization Optimizing the Data Transfer Path (DMA, buffers, data streaming)

Understanding Your Hardware

What is a DAQ System? Input Signals V Output Signals i V Signal Conditioning A/D D/A DIO TIO Application Software (LabVIEW) Measurement Services Software (NI-DAQmx)

Transducers Options Phenomena Temperature Light Sound Force and Pressure Position and Displacement Fluid ph Transducer Thermocouples Resistive Temperature Devices (RTDs) Thermistors Vacuum tube Photo sensors Microphone Strain gauges Piezoelectric transducers Potentiometers Linear voltage differential transformer Optical encoder Head meters Rotational flowmeters ph electrodes

Signal Conditioning High voltage signals and most sensors require signal conditioning to properly read the signal Sensors/Signals Thermocouples Signal Conditioning Amplification, Linearization, and Cold-Junction Compensation, Filtering RTDs Current Excitation, Linearization, Filtering Strain Gauges Voltage Excitation, Bridge Configuration, Linearization, Filtering Common Mode or High Voltages Isolation DAQ Device

NI Signal Conditioning Hardware Options SCC Modular Signal Conditioning SCXI FieldPoint Integrated Signal Conditioning PXI Instruments SC Series USB-9200 Series

NI DAQ Hardware Options Ethernet, Serial, or Wireless Distributed Desktop PXI Portable/Handheld

DAQ Device Subsystems Most DAQ devices have: Analog Input Analog Output Digital I/O Counters Applications specific devices for: High speed digital I/O High speed waveform generation Dynamic Signal Acquisition (vibration, sonar) MUX Multifunction DAQ Device DAC ADC Digital Counter Computer I/O Compatible with a variety of bus protocols: PCI, PXI/CompactPCI, PCI Express, PCMCIA, USB, 1394/Firewire RTSI

Analog Input Subsystem Uses an ADC (analog to digital converter) Converts analog signal to digital bits that a computer can manipulate Allows acquisition of real world analog signals

Analog Output Subsystem Architecture Accuracy Resolution Absolute Accuracy Range Adjustable versus Fixed Waveform Frequency Update Rate Settling Time Number of Cycles in the Buffer Channel 0 DAC Channel 0 Channel 1 DAC Channel 1

Digital I/O Subsystem General Terminology Bit: The smallest unit of data. Each bit is either a 1 or a 0. Line: One individual signal in a port. Bit refers to the data transferred. Line refers to the hardware. Port: A collection of digital lines

Counter/Timers Subsystem Gate Out Source Count Register Two basic functions: 1) To count based on the comparison of input signals (Gate, Source ) 2) To generate pulses based upon inputs and register value

NI-DAQmx and Measurement Services Streamlined API Polymorphic functions Automatic code generation Driver Architecture Multithreaded measurements Instant calibration Fast single-point operations Code generation Configuration Manager LabVIEW DAQ Assistant Hardware API Driver Engine NI-DAQmx Driver Software and Measurement Services

NI-DAQmx Fundamentals NI-DAQmx Task Virtual Channel Scale y=mx+b Units Physical channel Terminal configuration Input range Calibration Acquisition mode Triggering Timing Clock Source

Programming NI-DAQmx and LabVIEW Flexible programming options: DAQ Assistant Creating Tasks and Channels in MAX DAQ Assistant Express VI DAQmx Task Name Constant Automatic code generation NI-DAQmx API DAQmx VIs DAQmx Property Nodes

Demo Express VIs and NI-DAQmx VIs Implementing Pause Triggering

Understanding Your Timing Engine

Configuring Analog Input Clocks Sample clock and convert clock Multi-channel scanning considerations Using an internal clock Using an external clock Programmable functions input (PFI) pins

Sample and Convert Clock Sample Clock controls when a scan begins Convert Clock controls when each channel is sampled

Interval Scanning When only the sample rate is set, LabVIEW requests for NI-DAQmx to select the convert clock rate NI-DAQmx Selects fastest convert clock rate possible, then adds 10 µs to the interchannel delay

Demo Change Convert Clock Rate DAQmx Timing property node

Settling Time Time required for signal being amplified by PGIA to reach specified accuracy range To acquire accurate data, signal must settle within accuracy range before A/D conversion takes place Usually specified in LSBs (Least Significant Bits) 1 LSB = smallest voltage change detectable by the ADC

Programmable Gain Instrumentation Amplifier (PGIA) Applies gain to signal Can apply different gains to different channels As you multiplex between different channels, you must let the amplified signal settle before sampling it with the ADC

Factors That Affect Settling Time Multiplexing Characteristics of input signal Higher gains increase settling time Large voltage swings between channels increase settling time Source impedance High source impedance increases settling time due to charge injection Built up charge on mux from last channel must dissipate through the next channel The higher the source impedance, the more time is required for the charge to dissipate Transmission line resistance and capacitance

Source Impedance Source impedance > 1 kω may cause ghosting CH 0: Square Wave CH 1: DC Voltage (0.5 V) Source Impedance: 1 kω CH 0: Square Wave CH 1: DC Voltage (0.5 V) Source Impedance: 22 kω

Improve Accuracy and Reduce Ghosting Select transducer with low source impedance Reduce sampling rate and/or convert clock rate Implement a voltage follower circuit to decrease source impedance if > 1 kω Arrange signals to minimize voltage swings between channels Insert grounded channels between signal channels Avoid multiplexing sample one channel at a time

Internal Clocks Default clocking source NI-DAQ divides down onboard timebases to achieve sampling clocks Different boards offer different timebases DAQ-STC2: 20 MHz (default) or 100 khz

M Series Timebase and Clock Sources

M Series Clock Sources (Cont.) Reference clock The source of the internal timebase By default, Reference clock is set to none This means that it will use the onboard oscillator as the source of the internal timebase Setting the Reference clock to On-board Clock 10 MHz clock is passed to the Master device s Reference Clock source through RTSI so Master device has the same delay as slaves

External Clocks Analog Input Use a TTL compatible signal Analog Input External Sample Clock Input on any unused PFI pin (rising or falling edge) External Convert Clock Input on any unused PFI pin (rising or falling edge)

Programmable Function Input (PFI) Pins Serve as connections to virtually all internal timing signals Can input timing signal on any PFI pin Example: import digital trigger signal on PFI0 Can output timing signal on any PFI pin (M Series) Example: export AI sample clock on PFI7

Input Signal on Any PFI Pin NI-DAQmx: Select any PFI pin as source of signal Can specify active edge (rising/falling)

Output Signal on Dedicated PFI Pin Must turn on output driver to output signal NI-DAQmx: Use LabVIEW Export Signal VI Use C API Export Signal function

External Convert Clock (AI) NI-DAQmx does not allow disabling the sample clock Therefore, it is not possible for an external convert clock to solely control all of the A/D conversions The alternative is to provide both an external sample and convert clock

External Sample Clock (AI) If the source input of the DAQmx Timing VI is left unwired, the internal clock is used by default A rate must always be specified when using an external clock

Both Sample and Convert Clock (AI)

Timing Tool M and E Series diagrams Interactive Available on ni.com

Multiple Device Synchronization

Demo Synchronization

AI/AI Shared Sample Clock

Sharing a Timebase and Start Trigger

PLL Circuit Circuit that adjusts an oscillator so that its frequency is locked to a reference clock Can replace the native 10 MHz PXI clock with a more accurate clock to improve accuracy

Synchronizing PCI M Series Devices Recommended Method: Slave pulls Master s 10 MHz reference clock as its reference clock and sets the rate to 10 MHz Master sets the source of its reference clock to onboard clock By default, the reference clock is set to none which means that it uses the on-board oscillator Onboard clock causes the master s reference clock to be routed through RTSI to have the same delay as the slave

PCI M Series Synchronization

Reducing Clock Error in PXI PXI chassis has 10 MHz backplane clock Common reference clock provided to each slot Trace lengths matched to minimize skew May be replaced by another 10 MHz clock Devices phase-locked to the backplane clock Clock edges occur simultaneously Frequencies are derived from common 10 MHz backplane clock Replace backplane clock with high-stability 10 MHz clock to reduce clock error in PXI

Synchronizing PXI M Series Devices PXI M Series devices do not automatically phase lock to the PXI Clock Recommended Method: Set the source of all device reference clocks to PXI Clock 10 and set the reference clock rate to 10 MHz This causes the PLL circuit to output a clock that is phase locked to PXI Clock 10 Share a common start trigger between all devices and set all sample clocks to a common rate

PXI M Series Synchronization

Optimizing the Data Transfer Path

Data Transfer Mechanisms Programmed I/O Each read or write call in the application initiates the transfer of data Used for software timed operations Interrupt Request (IRQ) Relies on the CPU to service data transfer requests Transfer speed limited by the PC Used when point by point data is needed Direct Memory Access (DMA) Data is transferred directly to memory, bypassing the CPU Faster method of transfer than IRQ Typical (default) method of data transfer Limited number of DMA channels per board

Components of Streaming DMA Controller ` FIFO

Components of Streaming DMA Controller Buffer Local Bus ` FIFO FIFO

Buffer Overflow DMA Controller Buffer Local Bus ` FIFO

Run Error Demo

Solutions to Buffer Overflow Configure Task to Ignore Overflows Reduce Number of Concurrent Applications Increase Buffer Size, Tweak Number of Samples Per Read, Reduce Sample Rate Move to Off Line Analysis Use Unscaled or Raw Reads

Show Fixes to Error Demo

FIFO Overflow DMA Controller PCI Bus 32 Buffer Local Bus ` FIFO

Utilizing Onboard Memory DMA Controller Buffer Local Bus ` Trigger FIFO

Utilizing Onboard Memory DMA Controller Buffer Local Bus ` FIFO

Utilizing Onboard Memory Summary For Devices With Large Onboard Memory Reference triggered acquisitions are no longer limited by PCI bandwidth Finite Acquisitions Effective Buffer = Host Buffer + Onboard Memory 33 MS 1 MS = + Effective Buffer No longer require large buffers Fewer page locking issues Buffer 32 MS FIFO

Scaled, Unscaled, and Raw Data Waveform Data Timing And Attributes Scaled Data Scaling Unscaled Data Raw Data Channel 1 Channel 2 Channel 2 Channel 1 Reordering Buffer

Scaled, Unscaled, and Raw Data Waveform Data Scaled Data Unscaled Data Raw Data Performance / Throughput Ease of Use

Streaming to Disk Enhancements 0000100101101011 Unused Resolution DMA Controller Buffer Local Bus ` NI PCI-6110 FIFO

Resources ni.com/support Examples Knowledgebase Discussion forums Hardware/software manuals MAX Hardware manuals NI-DAQmx help documents Start menu Getting started guide Readme C Function reference manual