Summary: In this lesson, you will learn about plug-in DAQ devices.
LabVIEW includes a set of VIs that let you configure, acquire data from, and send data to DAQ devices. Often, one device can perform a variety of functions--analog-to-digital (A/D) conversion, digital-to-analog (D/A) conversion, digital I/O, and counter/timer operations. Each device supports different DAQ and signal generation speeds. Also, each DAQ device is designed for specific hardware platforms and operating systems. Refer to ni.com/daq for more information about DAQ devices.
DAQ System Components
Before a computer-based measurement system can measure a physical signal, such as temperature, a sensor or transducer must convert the physical signal into an electrical one, such as voltage or current. You might consider the plug-in DAQ device to be the entire measurement system, but it is actually only one system component. You cannot always directly connect signals to a plug-in DAQ device. In these cases, you must use signal conditioning accessories to condition the signals before the plug-in DAQ device converts them to digital information. The software controls the DAQ system by acquiring the raw data, analyzing, and presenting the results.
Consider the following options for a DAQ system:
- The plug-in DAQ device resides in the computer. You can plug the device into the PCI slot of a desktop computer or the PCMCIA slot of a laptop computer for a portable DAQ measurement system.
- The DAQ device is external and connects to the computer through an existing port, such as the serial port or Ethernet port, which means you can quickly and easily place measurement nodes near sensors.
The computer receives raw data through the DAQ device. The application you write presents and manipulates the raw data in a form you can understand. The software also controls the DAQ system by commanding the DAQ device when and from which channels to acquire data. Typically, DAQ software includes drivers and application software. Drivers are unique to the device or type of device and include the set of commands the device accepts. Application software, such as LabVIEW, sends the drivers commands, such as acquire and return a thermocouple reading. The application software also displays and analyzes the acquired data. NI measurement devices include NI-DAQ driver software, a collection of VIs you use to configure, acquire data from, and send data to the measurement devices.
NI-DAQ
NI-DAQ 7.0 contains two NI-DAQ drivers--Traditional NI-DAQ and NI-DAQmx--each with its own application programming interface (API), hardware configuration, and software configuration.
- Traditional NI-DAQ is an upgrade to NI-DAQ 6.9.x, the earlier version of NI-DAQ. Traditional NI-DAQ has the same VIs and functions and works the same way as NI-DAQ 6.9.x. You can use Traditional NI-DAQ on the same computer as NI-DAQmx, which you cannot do with NI-DAQ 6.9.x.
- NI-DAQmx is the latest NI-DAQ driver with new VIs, functions, and development tools for controlling measurement devices. The advantages of NI-DAQmx over previous versions of NI-DAQ include the DAQ Assistant for configuring channels and measurement tasks for a device; increased performance, including faster single-point analog I/O and multithreading; and a simpler API for creating DAQ applications using fewer functions and VIs than earlier versions of NI-DAQ.
Traditional NI-DAQ and NI-DAQmx support different sets of devices. Refer to the National Instruments Web site for the list of supported devices. This lesson describes the NI-DAQmx API.
Figure 1 shows the measurement software framework.
When programming an NI measurement device, you can use NI application software such as LabVIEW, LabWindows™/CVI™, and Measurement Studio, or open ADEs that support calling dynamic link libraries (DLLs) through ANSI C interfaces. Using NI application software greatly reduces development time for data acquisition and control applications regardless of which programming environment you use:
- LabVIEW supports data acquisition with the LabVIEW DAQ VIs, a series of VIs for programming with NI measurement devices.
- For C developers, LabWindows/CVI is a fully integrated ANSI C environment that provides the LabWindows/CVI Data Acquisition library for programming NI measurement devices.
- Measurement Studio development tools are for designing your test and measurement software in Microsoft Visual Studio .NET. Measurement Studio includes tools for Visual C#, Visual Basic .NET, and Visual C++ .NET.
DAQ Hardware Configuration
You must complete several steps before you can use the Data Acquisition VIs. The devices are configured for the computers in this class.
Windows
The Windows Configuration Manager keeps track of all the hardware installed in the computer, including National Instruments DAQ devices. If you have a Plug & Play (PnP) device, such as an E Series MIO device, the Windows Configuration Manager automatically detects and configures the device. If you have a non-PnP device, or legacy device, you must configure the device manually using the
Add New Hardware
option in the Control Panel.You can verify the Windows Configuration by accessing the Device Manager. You can see
Data Acquisition Devices
, which lists all DAQ devices installed in the computer. Double-click a DAQ device to display a dialog box with tabbed pages. The General
tab displays overall information regarding the device. The Resources
tab specifies the system resources to the device such as interrupt levels, DMA, and base address for software-configurable devices. The NI-DAQ Information
tab specifies the bus type of the DAQ device. The Driver
tab specifies the driver version and location for the DAQ device.LabVIEW installs Measurement & Automation Explorer (MAX), which establishes all device and channel configuration parameters. After installing a DAQ device in the computer, you must run this configuration utility. MAX reads the information the Device Manager records in the Windows Registry and assigns a logical device number to each DAQ device. Use the device number to refer to the device in LabVIEW. Access MAX either by double-clicking the icon on the desktop or selecting
Tools>>Measurement & Automation Explorer
in LabVIEW. The window in Figure 2 is the primary MAX window. MAX is also the means for SCXI and SCC configuration.MAX detects all the National Instruments hardware including the GPIB interface. Refer to Instrument Control, for more information about GPIB.
The device parameters that you can set using the configuration utility depend on the device. MAX saves the logical device number and the configuration parameters in the Windows Registry.
The plug and play capability of Windows automatically detects and configures switchless DAQ devices, such as the PCI-6024E. When you install a device in the computer, the device is automatically detected.
Channel and Task Configuration
In Traditional NI-DAQ you can configure a set of virtual channels, or a collection of property settings that include a physical channel, the type of measurement or generation specified in the channel name, and scaling information. In Traditional NI-DAQ and earlier versions, virtual channels are a simple method to remember which channels are used for different measurements. NI-DAQmx channels are similar to the virtual channels of Traditional NI-DAQ.
NI-DAQmx also includes tasks that are integral to the API. A task is a collection of one or more channels and the timing, triggering, and other properties that apply to the task itself. A task represents a measurement or generation you want to perform.
Channels created only inside a task are local. Channels defined outside a task are global and can be used separately. Configuring virtual channels is optional in Traditional NI-DAQ and earlier versions but is integral to every measurement you take in NI-DAQmx. In Traditional NI-DAQ, you configure virtual channels in MAX. In NI-DAQmx, you can configure virtual channels either in MAX or in a program, and you can configure channels as part of a task or separately.
GLOSSARY
- virtual channels:
- A collection of property settings that include a physical channel, the type of measurement or generation specified in the channel name, and scaling information
- task:
- A collection of one or more channels and the timing, triggering, and other properties that apply to the task itself. A task represents a measurement or generation you want to perform.
No comments:
Post a Comment