of 55
7/29/2019 Lesson 9 11
1/55
1
Lesson 9Data Acquisition and Waveforms
TOPICSPlug-in DAQ devices
Data Acquisition in LabVIEW Analog InputData Logging
Analog OutputCountersDigital I/O
7/29/2019 Lesson 9 11
2/55
2
Overview and Configuration
Fundamental task of a DAQ system is tomeasure or generate real-world physicalsignals
DAQ system consists of:TransducersSignal ConditioningPlug-in DAQ deviceDriver Software
7/29/2019 Lesson 9 11
3/55
3
MeasurementSoftwareFramework
NI-DAQ contains:Traditional NI-DAQNI-DAQmx
7/29/2019 Lesson 9 11
4/55
4
DAQ Hardware Configuration
Measurement & Automation Explorer (MAX)
7/29/2019 Lesson 9 11
5/55
5
Channels and Tasks
Signalsai 0ai 1
ai 2
Sine Wave 1
Sine Wave 2
Sine Wave 3
Channel names
TasksTiming and Triggering
7/29/2019 Lesson 9 11
6/55
The DAQ Signal Accessory
7/29/2019 Lesson 9 11
7/557
NI-DAQmx versus Traditional NI-DAQFeature NI-DAQmx Traditional NI-DAQ
Test Panels DAQ Assistant with code generation no
On-line diagnostics
Scaling to voltage and physical units
50 kS/s with single point I/O
Measurement multithreading Instant calibration
Automatic selection of optimal gains
Guaranteed lossless data
650 Alliance members
Integration with LabVIEW
Developer Exchange discussion forum
Compatible with Legacy ISA Boards no
Accuracy
Performance
Productivity
QualityBest
GoodFair Compatibility
7/29/2019 Lesson 9 11
8/558
Data Acquisition in LabVIEW
Traditional NI-DAQSpecific VIs for
performing: Analog Input Analog Output Digital I/O Counter operations
NI-DAQmxNext generation driver: VIs for performing a
task One set of VIs for all
measurement types
7/29/2019 Lesson 9 11
9/559
NI-DAQmx Data Acquisition
Single set of VIs used to perform analogI/O, digital I/O, and counter operations
DAQ Assistant Express VI Quickly and easily program the DAQ device Creates a local task Most applications can use the DAQ
Assistant Express VI
7/29/2019 Lesson 9 11
10/5510
NI-DAQmx Data Acquisition Task Types
Measurement typecan be: Analog Input Analog OutputCounter InputCounter Output
Digital I/O
7/29/2019 Lesson 9 11
11/5511
Analog Input
Analog Input taskis specific to the
measurement
7/29/2019 Lesson 9 11
12/5512
Analog Input Task Timing and Triggering
Configures the number of samples and sample rate for the task
Configures the start andreference triggers for the task
7/29/2019 Lesson 9 11
13/5513
Data Logging It is often necessary to permanently store data that is acquired
from the DAQ device LabVIEW includes the ability to read and write a LabVIEW
Measurement File
LabVIEW Measurement File is an ASCII text file
7/29/2019 Lesson 9 11
14/5514
Analog Output
Analog Output taskis specific to thegeneration type
7/29/2019 Lesson 9 11
15/5515
Analog Output Task Timing and Triggering
Configures the number of samples and sample rate for the task
Configures the start andreference triggers for the task
7/29/2019 Lesson 9 11
16/5516
Counters A counter is a digital timing device
Typical uses of a counter: Event counting Frequency measurement Period measurement Position measurement Pulse generation
Gate
Source
Output
Count Register
Count register Stores the current count of the counter
Source Input that causes the counter to increment each time it togglesGate Input that is used to enable or disable the function of the counter Output Signal that generates pulses or a series of pulses
7/29/2019 Lesson 9 11
17/5517
Digital Input and Output Digital I/O can
read from or writeto a line or anentire digital port
A digital port is acollection of digitallines
7/29/2019 Lesson 9 11
18/5518
Summary MAX is the primary configuration and testing utility that is
available for the DAQ device. The DAQ Assistant is used to configure the DAQ device and
perform data acquisition.
Most application can use the DAQ Assistant. For applicationsthat require advanced timing and synchronization use the VIsthat come with NI-DAQmx.
The DAQ Assistant can perform Analog Input, Analog Output,Digital I/O, and Counter operations.
7/29/2019 Lesson 9 11
19/5519
Lesson 10Instrument Control
TOPICSInstrument Control Overview
GPIB Communication and ConfigurationInstrument I/O AssistantVirtual Instrument Software Architecture (VISA)Instrument DriversSerial Port CommunicationWaveform Transfers
7/29/2019 Lesson 9 11
20/5520
Instrument Control OverviewControl any instrument if you know the following:
Type of connector on the instrument Type of cables needed Electrical properties involved Communication protocols used Software drivers available
Instruments Computer
7/29/2019 Lesson 9 11
21/55
GPIB Communication
GPIB Instruments
GPIBCable
GPIB Interface
7/29/2019 Lesson 9 11
22/5522
Standards Introduction
1965
1987
1990
1992
1993
1975
HP designs HP-IB (Hewlett Packard Interface Bus)
HP-IB becomes IEEE 488
IEEE 488.2 adoptedIEEE 488 becomes IEEE 488.1
SCPI (Standard Commands for ProgrammableInstruments) added to IEEE 488.2
IEEE 488.2 revised
HS488 proposed
1999 HS488 approved
7/29/2019 Lesson 9 11
23/5523
GPIB Hardware Specifications
Max cable length betweendevices = 4 m (2 m average) Max cable length = 20 m Max number of devices =
15 (2/3 powered on)1
12
13
24
DIO5
DIO6
DIO7 DIO8 REN GND (TW PAIR W/DAV) GND (TW PAIR W/NRFD) GND (TW PAIR W/NDAC) GND (TW PAIR W/IFC) GND (TW PAIR W/SRQ)
GND (TW PAIR W/ATN)
SIGNAL GROUND
DIO1
DIO2
DIO3 DIO4 EOI DAV
NRFD NDAC
IFC SRQ
ATN
SHIELD
7/29/2019 Lesson 9 11
24/55
GPIB Software Architecture Windows
Driver Software(*.DLL)
InstrumentDriver VIsNI-VISA
LabVIEW
Diagnostics Tools:
GPIB Diagnostic ToolNI-Spy
Configuration Tools:Measurement &Automation Explorer
Interface Board(GPIB, PXI,
VXI, computer based, etc.)
7/29/2019 Lesson 9 11
25/55
25
Configuring GPIB Board and Instruments
Measurement & Automation Explorer (MAX)
7/29/2019 Lesson 9 11
26/55
26
What is the Instrument I/O Assistant?
Accessed through a LabVIEWExpress VI Sets up device
communication and dataparsing step by step througha configuration interface
7/29/2019 Lesson 9 11
27/55
27
Communicating with an Instrument
7/29/2019 Lesson 9 11
28/55
28
Virtual Instrument Software Architecture
Platform independent VISA is the backbone of the
IVI and Plug & PlayInstrument Drivers
Interface independent Must know SCPI command
set to program directly withVISA
GPIB VXISerial PXI
VISA
7/29/2019 Lesson 9 11
29/55
29
VISA Terminology
Resource Instrument, Serial Port, or Parallel Port Session Connection to a Resource Instrument Descriptor Resource location
Format: Interface Type::Address::INSTR
Examples:
7/29/2019 Lesson 9 11
30/55
30
Instrument Descriptor Syntax Resource Name contains interface info VISA Aliases also work
Interface Resource Name Grammar
Serial ASRL[board][::INSTR]GPIB GPIB[board]:: primary address [::INSTR]
VXI VXI[board]:: VXI logical address [::INSTR]
GPIB-VXI GPIB-VXI[board][:: GPIB-VXI primary address ]:: VXI logical address [::INSTR]
7/29/2019 Lesson 9 11
31/55
31
VISA Resource Name
Exact name and location of the instrument Use the VISA Resource Name control You can specify the full resource name of the VISA Alias
7/29/2019 Lesson 9 11
32/55
32
Instrument Drivers
More than 1200 LabVIEW Instrument drivers Programming simplified to high-level API
7/29/2019 Lesson 9 11
33/55
33
Installing and Finding Instrument Drivers Drivers available atni.com/idnet
Install the instrument driver VI Library intoLabVIEW 7.0\instr.lib directory
Access drivers fromFunctionsInputInstrument Driverssubpalette
7/29/2019 Lesson 9 11
34/55
34
IDNET - Instrument Driver Network
Learn about drivers Get help with developing drivers Submit your driver to the network
Download drivers
7/29/2019 Lesson 9 11
35/55
35
Instrument Driver Model
7/29/2019 Lesson 9 11
36/55
36
Initialize
Configure
Action/Status
Data
Utility
Close
Instrument Driver VIs
7/29/2019 Lesson 9 11
37/55
37
Instrument Driver Inputs and Outputs
Instrument Descriptor VISA Sessions- A connection or link to a specific instrument- Created after instrument is initialized
- Used throughout VI whenever you communicate with that specificinstrument Error cluster
HP34401A Initialize.vi
7/29/2019 Lesson 9 11
38/55
38
Putting It All Together
Initialize instrument Do operation(s) Close instrument Check error status
7/29/2019 Lesson 9 11
39/55
39
Serial Communication Popular means of communication between computer and
peripheral device Data sent one bit at a time across the cable
Used for low transfer rates or long distances
Only a cable is needed since most computers have at leastone available serial port
RS-232 Instrument
RS-232 Cable
PC SerialPort
7/29/2019 Lesson 9 11
40/55
40
Serial Hardware Connection
RS-232 DCE or DTE
configurations
9-pin or 25-pin
RS-422
DCE or DTE
8-pin
RS-485 Multidrop
Pin DTE DCE
1 DCD Input Output2 RxD I O3 TxD O I4 DTR O I5 Com - -
6 DSR I O7 RTS O I8 CTS I O9 RI I O
7/29/2019 Lesson 9 11
41/55
41
Serial Communication
Terminology Baud rate bits per second Data bits inverted logic and LSB first Parity optional error-checking bit Stop bits 1, 1.5, or 2 inverted bits at data end Flow control hardware and software handshaking options
7/29/2019 Lesson 9 11
42/55
42
Using the Instrument I/O Assistant with Serial
Select COMX asthe instrumentaddress
Use the I/O Assistant as donewith GPIB
7/29/2019 Lesson 9 11
43/55
43
Summary LabVIEW can communicate with any instrument that connects to
your computer if you know the interface type Use the Measurement & Automation Explorer (MAX) to detect,
configure, and test your GPIB interface and instruments Use the Instrument I/O Assistant for easy and fast GPIB and serial
programming. An instrument driver eliminates the need for your to have detailed
knowledge of the specific strings used by an instrument Instrument Library more than 2000 instruments supported
Instrument driver VIs share a common hierarchy and come with anexample to help you get started
7/29/2019 Lesson 9 11
44/55
44
Lesson 11VI Customization
TOPICSConfiguring Appearance of Front PanelSubVI Front PanelsKeyboard ShortcutsVI PropertiesCustomizing Palettes
7/29/2019 Lesson 9 11
45/55
45
Customizing VI Properties Access VI Properties by right-clicking the icon pane or selecting it
from the File menu Affects every instance of that VI in all applications
7/29/2019 Lesson 9 11
46/55
46
Window AppearanceOnly affects VI panel while VI is running
7/29/2019 Lesson 9 11
47/55
47
Window Size Set minimum and current panel size
Adjust size of panel relative to the monitor Scale objects on
panel as windowresizes
7/29/2019 Lesson 9 11
48/55
48
Creating Pop-Up Panels Every Instance Use Top-Level Application Window or Dialog appearance types
Create custom window appearance
7/29/2019 Lesson 9 11
49/55
49
Creating Pop-Up Panels Single Instance
Access SubVI Node Setup by right-clicking on subVI icon oncalling VIs diagram
7/29/2019 Lesson 9 11
50/55
50
Key Navigation Assigns keyboard strokes tofront panel controls
7/29/2019 Lesson 9 11
51/55
51
Preventing Editing of a VI Opens, runs, and closes LabVIEW without
user intervention Remove menus, Abort button, etc
Save with Options
7/29/2019 Lesson 9 11
52/55
52
Summary Use VI Properties to set VI execution, window, and documentation
options Use SubVI Node Setup to set execution options for a single
instance of a subVI Use the Key Navigation option to assign front panel controls to a
keyboard key combination Use the Save with Options from the file menu to make backups of
your VIs You can often edit VIs by aborting them from the diagram of
another VI
7/29/2019 Lesson 9 11
53/55
53
Technical Support Resources
Award-Winning Websitewww.ni.com/support Drivers & UpdatesProduct Manuals
KnowledgeBasesExample CodeTutorials Application NotesDiscussion Forums
http://www.ni.com/supporthttp://www.ni.com/support7/29/2019 Lesson 9 11
54/55
54
Info-LabVIEW ListserveUser-sponsored Internet mailing list
Send subscription messages to the Info-LabVIEW list processor [email protected]
Send other administrative messages to the Info-LabVIEW listmaintainer at
Post a message to subscribers [email protected]
7/29/2019 Lesson 9 11
55/55
LabVIEW Publications
LabVIEW Technical Resourcequarterly newsletter by LTRPublishing LabVIEW Graphical Programming and LabVIEW Power
Programming by Gary W. Johnson, McGraw-Hill
LabVIEW for Everyoneby Lisa K. Wells and Jeffrey Travis,Prentice-Hall
LabVIEW Signal Processing by Mahesh Chugani, Abhay Samant,and Michael Cerna, Prentice-Hall
LabVIEW Applications and Solutionsby Rahman Jamal and HerbertPichlik, Prentice-Hall