Project 02

6
Data Acquisition Using NI-DAQmx Wei Lin Department of Biomedical Engineering Stony Brook University Instructor’s Portion Summary This experiment requires the student to use NI- DAQmx to acquire voltage signals. Students should be familiar with the following LabVIEW programming technique 1. NI-DAQmx 2. LabVIEW application for data acquisition 3. LabVIEW graph and chart 4. LabVIEW “write LabVIEW measurement file” express VI Uses This lecture applies to all courses of virtual instrumentation. Equipment List Computers LabVIEW 7 Express NI-ELVIS benchtop workstation Submitting an Experiment 1

description

Project 02

Transcript of Project 02

Title

Data Acquisition Using NI-DAQmxWei Lin Department of Biomedical EngineeringStony Brook UniversityInstructors Portion

Summary

This experiment requires the student to use NI-DAQmx to acquire voltage signals. Students should be familiar with the following LabVIEW programming technique1. NI-DAQmx2. LabVIEW application for data acquisition3. LabVIEW graph and chart4. LabVIEW write LabVIEW measurement file express VIUses

This lecture applies to all courses of virtual instrumentation.

Equipment List

Computers LabVIEW 7 Express

NI-ELVIS benchtop workstation

References

LabVIEW Users Manual. April 2003

LabVIEW Introduction Course - Six Hours.

LabVIEW Introduction Course - Three Hours Lecture Slides of LabVIEW Programming, Part IV

Students Portion

Introduction

The students should learn the basic LabVIEW programming techniques for the data acquisition using NI-DAQmx. They will create two VIs, one for finite samples and the other for continuous samples. Students will use graph and chart indicator to display acquired signals on the screen and save the data in files for future analysis.Objectives NI-DAQmx Data acquisition programming using NI-DAQmx LabVIEW graph and chartTheory

NI-DAQmx is the next generation drivers for the data acquisition hardware from National Instruments. It is easy to use and has many new features such as improved ease of use, faster development time, multithreaded measurements and increased accuracy of measurements. The data acquisition application in LabVIEW and NI-DAQmx is quite straightforward. The following are the steps for creating such an application.

1. Create a virtual channel and task using the NI-DAQmx Create Virtual Channel VI.2. Set the sampling frequency and sampling mode, continuous or finite samples using NI-DAQmx Timing VI.3. Set the trigger using NI-DAQmx Trigger VI. This step is optional.4. Start the data acquisition process using NI-DAQmx Start VI.5. Read the acquired data using NI-DAQmx Read VI.6. Clear the data acquisition task using the NI-DAQmx Clear VI.

All the NI-DAQmx VIs are linked through task in and task out terminal and the error cluster chain. For continuous samples mode, the NI-DAQmx Read VI should be placed within a while loop.Lab Procedure

Experiment 1, Create a LabVIEW data acquisition application of finite samples:1. Launch LabVIEW.2. Create a blank VI.3. The front panel should have the following numeric controls: minimum value, maximum value, sample frequency and number of samples. It should also have the NI-DAQmx physical channel control and error cluster control.4. Drop the NI-DAQmx Create Virtual Channel VI to the block diagram and choose AI voltage. Connect controls of minimum value, maximum value, physical channel and error cluster to the respective terminals. Wire a numerical constant 10083 to the input terminal configuration terminal. This configures the input as referenced single ended terminal. 5. Drop the NI-DAQmx timing VI to the block diagram and choose Sample clock. Connect controls of sampling frequency and the number of samples to the respective terminal. Connect a numeric constant of 10178 to the sample mode terminal. This configures the finite sample mood. 6. Drop the NI-DAQmx Start VI to the block diagram.7. Drop the NI-DAQmx read VI to the block diagram. Select analog 1D Wfm NCha NSamp and connect the control of the number of samples to the terminal number of samples per channel.

8. Drop the NI-DAQmx Clear VI to the block diagram.

9. Drop a waveform indicator on the front panel. Connect the output from the terminal data of NI-DAQmx read VI to the waveform indicator.10. Connect the NI-DAQmx VIs through task in and task out terminals and error cluster input and output terminals.11. Drop a General Error Handler VI to the block diagram and connect the error output of the NI-DAQmx Clear VI to it.

12. Drop a Write LabVIEW Measurement File express VI to the block diagram and connect the acquired data to it.

13. Keep the ELVIS unit off. Connect the output of function generator FUNC OUT to ACH0 using connection wire on the prototype board. 14. Turn ELVIS unit on including the prototype board.

15. Launch ELVIS application and choose function generator.

16. Select the frequency, waveform type and amplitude of the function generator and turn it on.

17. Enter the parameters for the controls of the LabVIEW data acquisition controls and run.

18. Save acquired signal for lab report.

Experiment 2, Create a LabVIEW data acquisition application of continuous samples:

1. Modify the LabVIEW code of previous experiment by changing the sample mode constant for NI-DAQmx timing VI to 10083 for continuous sampling. Remove the wire connecting the number of samples control to this VI.

2. Change the waveform indicator to chart indicator.3. Using WHILE loop to enclose the NI-DAQmx read VI.

4. Remove the Write LabVIEW Measurement File express VI.5. Run the application as described in the previous experiment.Lab Report

The lab report should contain the following:1. The experiment title

2. The experiment objective

3. The experiment procedure and theory4. Discussion5. You may add your lab design into this project.Please submit the report through email.

EMBED Equation.3

Submitting an Experiment

3

_1058776443.unknown