Professional Documents
Culture Documents
You Will Learn: A. About plug-in data acquisition (DAQ) boards B. About the organization of the DAQ VIs C. How to perform a single analog input D. About the DAQ Wizards E. About waveform analog input F. How to write waveforms to file G. How to scan multiple analog channels H. How to output an analog signal I. How to drive the digital I/O lines J. About buffered data acquisition
LV Basics I 157
Overview
DAQ library supports all DAQ boards LabVIEW uses the NI-DAQ driver-level software DAQ boards for Analog I/O Digital I/O Counter/timer I/O Data acquisition system components
LV Basics I 158
Range Gain
16-bit 3-bit
Amplitude (volts)
50
150
200
LV Basics I 159
Averaging
LV Basics I 160
DAQ-STC
LV Basics I 162
LV Basics I 163
LV Basics I 164
DAQ VI Organization
Analog Input Analog Output Digital I/O Counter
LV Basics I 165
Single-point VIs
LV Basics I 166
LV Basics I 167
LV Basics I 168
LV Basics I 169
DAQ Wizards
DAQ Channel Wizard DAQ Solution Wizard
LV Basics I 170
LV Basics I 171
LV Basics I 172
LV Basics I 173
LV Basics I 174
LV Basics I 175
LV Basics I 176
LV Basics I 177
LV Basics I 178
LV Basics I 179
Waveform Generation VI
LV Basics I 180
LV Basics I 181
LV Basics I 182
LV Basics I 183
Intermediate VIs - Highly recommended for most applications - Continuous acquisition with triggering available - Interval scanning - Different gains for different channels - Streaming data to disk - Error handling
LV Basics I 184
LV Basics I 186
LV Basics I 187
Summary
Use the Measurement & Automation Explorer to configure DAQ boards and virtual channels DAQ VIs organized into five subpalettes Analog Input, Analog Output, Digital I/O, Counter, Configuration and Calibration, and Signal Conditioning Analog Input and Output subpalettes are divided into levels Easy I/O, Intermediate, Advanced, and Utility VIs Easy I/O contains VIs for Single-channel analog input and output Single-channel waveform input and output Multichannel waveform input and output Digital input and output Continuous DAQ can be performed using the intermediate VIs of AI Config, AI Start, AI Read, and AI Clear
LV Basics I 188
8-13 -- Students use the DAQ Solution Wizard to open Simple Data Reader.vi
Time to complete: 25 min.
LV Basics I 189
LV Basics I 191
GPIB Communication
GPIB Instrument GPIB Interface
GPIB Cable
1965
LV Instr 1-192
1975
1987
1990
DIO1 DIO2 DIO3 DIO4 EOI DAV NRFD NDAC IFC SRQ ATN SHIELD
13
12 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
LV Basics I 193
LV Basics I 194
LV Basics I 195
Students use MAX to examine the GPIB board settings and communicate with an instrument
Time to complete: 20-25 min.
LV Basics I 196
Instrument Drivers
More than 650 LabVIEW instrument drivers Programming simplified to high-level API
LV Basics I 197
LV Basics I 198
LV Basics I 199
Instrument Drivers
Instrument drivers have a similar hierarchy
NI DEVSIM Initialize.vi
VISA Sessions A connection or link to a specific instrument Created after instrument is initialized Used throughout VI whenever you communicate with that specific instrument Error Clusters
LV Basics I 201
You can specify the full resource name or the VISA Alias
LV Basics I 202
Error Clusters
LV Basics I 203
LV Basics I 204
VISA
Serial
OS Calls
GPIB
NI-488.2
VXI
NI-VXI
PXI
Platform independent Interface independent Interface to Serial, GPIB, and VXI instruments Uses VISA.DLL
VISA Terminology
ResourceInstrument, Serial Port, or Parallel Port SessionConnection to a Resource Instrument DescriptorResource location Format: Interface Type::Address::INSTR
Examples:
LV Basics I 206
LV Basics I 207
VISA Functions
LV Basics I 208
LV Basics I 209
Serial Communication
RS-232 Instrument PC Serial Port
RS-232 Cable
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 least one available serial port
LV Instr 1-210
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
LV Basics I 211
Serial VIs and functions also work with parallel port communication
LV Basics I 213
Initialize the serial port settings Write commands to the device Read device response Check for errors
LV Basics I 214
LV Basics I 215
2-byte integers
LV Basics I 216
LV Basics I 217
LV Basics I 218
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 An instrument driver eliminates the need for your to have detailed knowledge of the specific strings used by an instrument Instrument Library more than 650 instruments supported Instrument driver VIs share a common hierarchy and come with an example to help you get started VISA a standard protocol for using multiple types of I/O and instrument driver development Serial library contains functions for serial communication You need to know the format of the returned data string in order to convert it to the correct values
LV Basics I 219
Additional Exercises on page 9-51 9-8 Students use the NI DEVSIM Getting Started VI to communicate in serial mode with
a device
Time to complete: 20-25 min.
LV Basics I 220
Lesson 10 VI Customization
You Will Learn: A. B. C. D. E. How to customize the panel window How to create pop-up panels How to use Key Navigation How to edit VIs with disabled options About customizing palettes
LV Basics I 221
Customizing VI Properties
Access VI Properties... by right-clicking on icon pane or selecting it from the File menu Affects every instance of that VI in all applications
LV Basics I 222
Window Appearance
Only affects VI panel while VI is running
LV Basics I 223
Window Size
Set minimum and current panel size Adjust size of panel relative to the monitor Scale objects on panel as window resizes
LV Basics I 224
LV Basics I 225
LV Basics I 226
Pop-Up Graph.vi
Time to complete: 20-30 min.
LV Basics I 227
Key Navigation
Assigns keyboard strokes to front panel controls
LV Basics I 228
LV Basics I 229
LV Basics I 230
LV Basics I 231
LV Basics I 232
LV Basics I 233
LV Basics I 234
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 You can fully customize the Control and Function palettes from the Option button in the Function Browser window
LV Basics I 235