Example: confidence

Data Acquisition Using NI-DAQmx

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 NI-ELVIS benchtop workstation References LabVIEW 8, Student Version Lecture Slides of data Acquisition Student's Portion Introduction The students should learn the basic LabVIEW programming techniques for the data Acquisition Using NI-DAQmx . They will create two VIs, one 1. 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.

1 Data Acquisition Using NI-DAQmx Wei Lin Department of Biomedical Engineering Stony Brook University Instructor’s Portion Summary This experiment requires the student to …

Tags:

  Using, Data, Acquisition, Daqmx, Data acquisition using ni daqmx

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Data Acquisition Using NI-DAQmx

1 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 NI-ELVIS benchtop workstation References LabVIEW 8, Student Version Lecture Slides of data Acquisition Student's Portion Introduction The students should learn the basic LabVIEW programming techniques for the data Acquisition Using NI-DAQmx . They will create two VIs, one 1. 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.

2 Objectives NI-DAQmx Functions data Acquisition programming Using NI-DAQmx LabVIEW graph and chart Theory 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. Stop data Acquisition task.

3 7. 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. Create a blank VI. 2. Add the following to the front panel: a. Controls: NI-DAQmx physical channel, minimum value, maximum value, sample frequency, number of samples. Change the representation of number of samples control to I32. 2. b. Indicator: Waveform graph 3. Drop the following functions to the block diagram. a. NI-DAQmx Create Virtual Channel VI and choose AI. voltage . b. NI-DAQmx timing VI and choose Sample clock . c. NI-DAQmx Start Task VI. d. NI-DAQmx read VI and select analog 1D Wfm NCha NSamp . e. NI-DAQmx Stop Task VI. f.

4 NI-DAQmx Clear VI. g. Simple Error Handler VI. h. Align the VIs Using alignment tool. 4. For NI-DAQmx Create Virtual Channel VI , Connect the controls of minimum value, maximum value and physical channel to the respective terminals. Right click the input terminal configuration . terminal and choose create constant . Select RSE to configure the input as referenced single ended terminal. 5. For NI-DAQmx timing VI Connect controls of sampling frequency and the number of samples to the respective terminals. Right click the sample mode terminal and choose create constant . Select the constant as finite samples . This configures the finite sample mood.. 6. For NI-DAQmx read VI , connect the control of the number of samples to the terminal number of samples per channel . Connect the output from the terminal data of NI-DAQmx read VI to the waveform indicator. 7. Connect the NI-DAQmx VIs through task in and task out.

5 Terminals and error cluster input and output terminals. connect the error output of NI-DAQmx Clear VI to the input of Simple Error Handler VI . 8. Drop a Write LabVIEW Measurement File express VI to the block diagram and choose Ask user to choose file , Ask each iteration , Overwrite file and one column only in X value column . Connect the acquired data to its input. 9. Save the VI on your H drive. 10. Keep the ELVIS unit off. Connect the output of function generator FUNC OUT to ACH0 Using connection wire on the prototype board. 11. Turn ELVIS unit on including the prototype board. 12. Launch ELVIS application and choose function generator. Select the frequency, waveform type and amplitude of the function generator and turn it on. 13. Enter the parameters for the controls of the LabVIEW data Acquisition controls, run the VI and save acquired signal for lab report. 3. Experiment 2, Create a LabVIEW data Acquisition application of continuous samples: 1.

6 Modify the LabVIEW code of previous experiment by changing the sample mode constant for NI-DAQmx timing VI to continuous . for continuous sampling. Remove the wire connecting the number of samples control to this VI. Remove the Write LabVIEW. Measurement File express VI. 2. Replace the waveform indicator to chart indicator and add a STOP. button on the front panel. 3. Change the X axis scale of the chart by right clicking the chart and choosing properties, scales. Disable auto scale of X axis. Set the minimum as 0 and maximum as 5. 4. Using WHILE loop to enclose the NI-DAQmx read VI in the block diagram. Move the STOP button terminal into the WHILE. loop and connect it to the WHILE loop conditional terminal. Save the VI to your H drive. 5. Set the frequency of ELVIS function generator to 5Hz. Run the application as described in the previous experiment. Lab Report The lab report should contain the following: 1.

7 The experiment objective 2. Explain how to write a data Acquisition application Using LabVIEW. Please also describe the physical channel, virtual channel, task and their relationship. 3. data (collected signal). 4. LabVIEW VIs with documentation Lab report due on 10/17/2009. Appendix 1. VI for finite data Acquisition 4. 2. VI for continuous data Acquisition 5.


Related search queries