DOC

Data Acquisition Fundamentals

By Sue Morgan,2014-04-10 10:42
8 views 0
Data Acquisition Fundamentals

    Data Acquisition Fundamentals

    Sarah Fenney

    Arizona State University

Instructor’s Portion

    Summary

    The students will learn about the basics of data acquisition. First, they

    will configure their data acquisition hardware in Measurement &

    Automation Explorer. Then, they will examine the data acquisition VIs in

    LabVIEW. Finally, the students will develop analog input applications. Uses

    This homework applies to all general instrumentation courses. Equipment List

    ; Computer with LabVIEW 6.1

    ; PCI-6024E Data Acquisition Board

    ; BNC-2120 Connector Block

    ; SH68-68-EP Shielded Cable

    ; BNC to BNC cables

    References

    ; LabVIEW User’s Manual. November 2001. Part Number 320999D-

    01. http://www.ni.com/manuals.

    ; LabVIEW Student Edition. http://www.ni.com/labviewse.

    ; LabVIEW Introduction Course - Six Hours.

    ; LabVIEW Introduction Course - Three Hours.

     1

Student’s Portion

    Introduction

    In this lab, you will learn about the basics of data acquisition. First, you

    will configure your data acquisition hardware in Measurement &

    Automation Explorer. Then, you will examine the data acquisition VIs in

    LabVIEW. Finally, you will develop analog input applications. Objective

    ; Learn the three DAQ device grounding modes.

    ; Learn the uses of Measurement & Automation Explorer.

    ; Differentiate between single-point acquisition, continuous acquisition,

    and buffered acquisition.

    Theory

    Measurement & Automation Explorer

    Introduction

    Measurement & Automation Explorer, or MAX, is a software interface

    that gives you access to all National Instruments DAQ, GPIB, IMAQ, IVI,

    Motion, VISA, and VXI devices connected to your system. The shortcut to

    MAX is placed on the desktop during installation of NI-DAQ. MAX is

    used primarily to configure and test National Instruments hardware, but it

    offers other functionality, such as checking to see if you have the latest

    version of NI-DAQ installed. The functionality of MAX is divided into

    four categories:

    • Data Neighborhood

    • Devices and Interfaces

    • Scales

    • Software

     2

Data Neighborhood

    Data Neighborhood contains the virtual channels. The Data Neighborhood category shows you the currently configured virtual channels and provides utilities for testing and reconfiguring those virtual channels. Data Neighborhood also provides access to the DAQ Channel Wizard, which allows you to create new virtual channels.

    DAQ Channel Wizard

    The DAQ Channel Wizard is a software interface that lets you create

    new virtual channels. A virtual channel is a shortcut to a configured

    channel in the system. You can set up the configuration information

    for the channel and give the channel a descriptive name at the same

    time. Later, you can use the descriptive name to access that channel

    and its configuration information in LabVIEW. You can give the

    channel a description, decide what type of transducer the channel will

    use, set the range (determines gain), choose the grounding mode,

    assign custom scaling for the virtual channel, and give the channel a

    descriptive name to replace the channel number all at the same time.

    For example, channel 0 on the BNC-2120 is hardwired to a

    temperature sensor, so you could create a virtual channel for channel 0

    and call it Temperature Sensor. You can create virtual channels for

    analog input, analog output, and digital I/O. In this case, referring to a

    channel by a name (Temperature Sensor) instead of a number (0) helps

    you remember what the channel does.

Devices and Interfaces

    Devices and Interfaces displays the currently installed and detected National Instruments hardware. Devices and Interfaces also includes utilities for configuring and testing devices. The two utilities that are specific to DAQ devices are Properties and Test Panels.

    Properties

    Properties is a utility for configuring DAQ devices. When you launch

    the Properties utility, a dialog box appears with the following tabs that

    you can use to configure the DAQ devices.

    SystemThe System tab allows you to change the device number,

    and it provides two buttons for testing the DAQ device. The first

    button is the Test Resources button. After you have installed the DAQ

    device, right-click Devices and Interfaces. Select Properties and

    right-click Test Resources. This button performs a basic test of the

     3

    system resources assigned to the device. The system resources tested are the base I/O address, the interrupt request (IRQ), and the direct memory access (DMA).

     Base I/O AddressA DAQ device communicates with a

    computer primarily through its registers. NI-DAQ writes to

    configuration registers on the device to configure the device, and

    reads data registers on the device to obtain the device status or a

    signal measurement. The base I/O address setting determines

    where in the computer’s I/O space the device registers reside.

     Interrupt Request (IRQ)Another way the DAQ device

    communicates with the computer is through processor interrupts,

    which give the processor the ability to respond quickly to its

    peripherals. In the case of a DAQ device, it is not efficient for the

    processor to continually check if data is ready to be read from the

    device. A DAQ device can use an interrupt that signals the

    processor that it has data waiting to be read. Each interrupt request

    has a number assigned to it.

     Direct Memory Access (DMA)The third way the DAQ

    device can communicate with the computer is through direct

    memory access (DMA). DMA is a data transfer method in which

    data is transferred directly from the peripheral to computer

    memory, bypassing the processor. DMA is usually required to

    achieve maximum data transfer speed, making it useful for high-

    speed DAQ devices. DAQ devices that use the PCI bus have their

    own onboard DMA channels, and the PCI bus handles the sharing

    of that DMA.

    AI. The AI tab allows you to configure the default Polarity/Range for the ADC and the default mode for grounding the DAQ device. The default is applied only if the settings aren’t changed in LabVIEW.

    AO. The AO tab configures the default polarity of the analog output signal, and allows you to specify if you are using an external voltage reference for the DAC.

Accessory. The Accessory tab specifies any accessories you are

    using with the DAQ device such as the TBX-68 (terminal block with built-in cold-junction compensation). If NI-DAQ does not need to know about the accessory, it will not be on the list. In that case, choose None.

     4

    OPC. The OPC tab allows you to set the AI recalibration period if

    you are using the NI-DAQ OPC server. The use of the NI-DAQ OPC

    Server is beyond the scope of this lab.

    Test Panels

    After the device passes the basic resource test and you configure the

    System, AI, AO, Accessory, and OPC tabs, return to the System tab

    and click the Test Panels button. The Test Panel is a utility for testing

    the analog input, analog output, digital I/O, and counter functionality

    of the DAQ device. The Test Panel is useful for troubleshooting

    because it allows you to test the functionality of the device directly

    from NI-DAQ. If the device does not work in the Test Panel, it will not

    work in LabVIEW. If you ever have unexplainable trouble with data

    acquisition in a LabVIEW program, use the Test Resources button

    and the Test Panels button to make sure the device is working

    properly.

Scales

    Scales shows you all the currently configured custom scales and provides utilities for testing and reconfiguring those custom scales. Scales also provides access to the DAQ Custom Scales Wizard, which allows you to create new custom scales.

    DAQ Custom Scales Wizard

    The DAQ Custom Scales Wizard is a utility that creates custom scales

    you can use to determine scaling information for existing virtual

    channels. Each custom scale can have its own name and description to

    help you identify it.

    A custom scale can be one of three types: linear, polynomial, or table.

    LinearA scale that uses the formula y = mx + b.

    PolynomialA scale that uses the formula

    y = a0 + (a1 * x) + (a2 * x2) + … + (an* xn).

    TableA scale in which you enter the raw value and the

    corresponding scaled value in a table format.

Software

    Software shows all the currently installed National Instruments software. The icon for each software package is also a shortcut that you can use to launch the software. The Software category also includes a Software Update Agent. The purpose of the Software Update Agent is to check if the National Instruments software is the latest version. If the software isn’t

     5

    the latest version, the Software Update Agent opens the Web page on ni.com to download the latest version of the software.

    Software Architecture for Windows

    The main component of NI-DAQ, the nidaq32.dll, makes function

    calls directly to a DAQ device. The function that the nidaq32.dll

    performs depends on where you access it from. Both MAX and

    LabVIEW can talk to NI-DAQ. MAX is used primarily for

    configuring and testing the DAQ device. MAX not only helps

    configure devices, but it also tells you what devices are present in the

    system. To do this, MAX must communicate with the Windows

    Device Manager and the Windows Registry.

     6

Organization of Data Acquisition VIs

Most of the Data Acquisition VIs located on the Functions?Data

    Acquisition palette are grouped in the following levels according to their functionality:

    • Easy VIs

    • Intermediate VIs

    • Utility VIs

    • Advanced VIs

Easy VIs

    Easy VIs perform simple DAQ operations and typically reside in the first row of VIs in a palette. You can run these VIs from the front panel or use them as subVIs in basic applications.

    You need only one Easy VI to perform each basic DAQ operation. Unlike Intermediate and Advanced VIs, Easy VIs automatically alert you to errors with a dialog box that allows you to stop the execution of the VI or to ignore the error.

Intermediate VIs

    Intermediate VIs have more hardware functionality and efficiency in developing applications than Easy VIs. Use Intermediate VIs in most applications. Intermediate VIs give you more control over error handling than Easy VIs. With each VI, you can check for errors or pass the error cluster to other VIs.

     7

Utility VIs

    Utility VIs are also intermediate-level VIs and thus have more hardware functionality and efficiency in developing an application than Easy VIs. Utility VIs consist of convenient groupings of Intermediate VIs. They are for situations where you need more functionality control than the Easy I/O VIs provide but want to limit the number of VIs you call.

Advanced VIs

    Advanced VIs are the lowest-level interface to the DAQ driver. Very few applications require the use of Advanced VIs. Advanced VIs return the greatest amount of status information from the DAQ driver. Use Advanced VIs when Easy or Intermediate VIs do not have the inputs necessary to control an uncommon DAQ function.

     8

Homework Procedure

    Part 1. Measurement & Automation Explorer (MAX)

    In Part 1, you will become familiar with the installation and configuration of a data acquisition device. This exercise also gives a detailed tour of MAX.

    1. Connect the sine wave from the function generator to analog in 1 on the

    BNC-2120.

2. Connect analog out 0 to analog in 2.

    3. Launch MAX by double-clicking the icon on the Windows desktop.

4. Double-click the Devices and Interfaces category. MAX searches for

    installed hardware and lists the National Instruments devices found. A device number in parentheses is assigned to each device in the system. The LabVIEW DAQ VIs use this number to specify which device the VIs address. If the device is not listed, go to View?Refresh.

    5. Right-click the DAQ device folder for the specific device and select Properties. A configuration dialog box appears.

The Configuration dialog box contains several tabs. The System tab

    allows you to change the device number of the DAQ device. It also reports the system resources assigned to the device through the Windows Registry. The system resources shown in the Configuration dialog box include the

    following items:

Input/Output Range (Base I/O Address)The DAQ device

    communicates with the computer primarily through its registers. The base I/O address setting determines where in the computer I/O space the device registers reside.

Interrupt Request (IRQ)An interrupt gives the processor the ability

    to respond quickly to its peripherals. Think of a processor interrupt as a doorbell. If you did not have a doorbell, you would have to go to the door periodically to see if anyone were there. With a doorbell, you need to go to the door only when the doorbell rings, and you are confident that someone is there waiting. Likewise, a DAQ device uses an interrupt as a doorbell to tell the processor that it has data waiting to be read. Every device that uses processor interrupts must be assigned a different interrupt level, or the devices can conflict with each other.

     9

Direct Memory Access (DMA)DMA is a data transfer method in

    which data is transferred directly from the peripheral to computer memory, bypassing the processor. DMA is usually required to achieve maximum data transfer speed, making it useful for high-speed DAQ devices. DAQ devices that use the PCI bus have their own onboard DMA channels, and the PCI bus handles the sharing of that DMA. DAQ devices that use the AT/ISA bus must assign themselves a DMA channel from the computer.

6. Select the Input/Output Range. Click View below the Resources dialog

    box. You can use the dialog box that appears to configure non-Plug and

    Play devices manually. If you have a Plug and Play device, the computer

    automatically configures the system resources and the Input/Output Range

    is dimmed.

    7. Click the AI tab. This tab allows you to set the default polarity/range and grounding mode used for analog input signals. These default values are used by NI-DAQ as long as other settings do not override them.

    8. Click the AO tab. This tab allows you to set the default analog output polarity.

    9. Click the Accessory tab to specify any accessories that are attached to the DAQ device. Select the BNC-2120 from the list.

    Devices on the Accessory list usually provide some form of signal conditioning for signals, or they increase the number of channels you can measure. If an accessory does not change the way signals are measured, it does not appear on the Accessory list.

    10. Click the OPC tab. The OPC tab allows you to set the recalibration period when using an OPC server. The use of an OPC server is beyond the scope of this lab.

    11. Complete the following steps to verify the DAQ system is set up correctly.

    a. Click the System tab.

    b. Click Test Resources. This action tests the system resources

    assigned to the device.

    c. Click OK.

12. On the System tab, click Run Test Panels. The following front panel

    appears. The Analog Input tab allows you to read the analog input

    channels. Channel 0 can be configured as the temperature sensor on the BNC-2120. You should see a voltage between 0.2 and 0.3 V displayed on the graph.

     10

Report this document

For any questions or suggestions please email
cust-service@docsford.com