Example: air traffic controller

Signal Generation Using NI-DAQmx

Signal Generation 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 generate analogy voltage signals of sinusoidal, triangle, square wave and user defined wave. Students should be familiar with the following LabVIEW. programming technique 1. NI-DAQmx 2. LabVIEW application for analog Signal Generation 3. LabVIEW Simulate Signal express VI. 4. LabVIEW Simulated ECG Signal Express VI. Uses This lecture applies to all courses of bioinstrumentation. Equipment List Computers LabVIEW NI-ELVIS benchtop workstation References LabVIEW Student Edition Student's Portion Introduction The students should learn the basic LabVIEW programming techniques for the Signal Generation Using NI-DAQmx .

1 Signal Generation 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 generate

Tags:

  Using, Generation, Signal, Signal generation using ni daqmx, Daqmx, To generate, Generate

Information

Domain:

Source:

Link to this page:

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

Other abuse

Transcription of Signal Generation Using NI-DAQmx

1 Signal Generation 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 generate analogy voltage signals of sinusoidal, triangle, square wave and user defined wave. Students should be familiar with the following LabVIEW. programming technique 1. NI-DAQmx 2. LabVIEW application for analog Signal Generation 3. LabVIEW Simulate Signal express VI. 4. LabVIEW Simulated ECG Signal Express VI. Uses This lecture applies to all courses of bioinstrumentation. Equipment List Computers LabVIEW NI-ELVIS benchtop workstation References LabVIEW Student Edition Student's Portion Introduction The students should learn the basic LabVIEW programming techniques for the Signal Generation Using NI-DAQmx .

2 They will create one VI for 1. the Generation of a continuous function waveform such as a sinusoidal Signal . Students will use VIs developed in the project Data Acquisition Using NI-DAQmx to verify the signals generated. Objectives NI-DAQmx Analog Signal Generation 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. NI-DAQmx can also be used to generate analog signals if the data acquisition hardware has the analog output capability.

3 The Signal Generation application is as straightforward as the data acquisition application. 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. Select Analog output and than voltage. 2. Create the waveform data for the analog Signal Generation . You can use Signal simulation VI to create the waveform. You must set the sample rate and number of samples correct to ensure the waveform generated is one or multiple cycles. (why?). 3. Set the sampling frequency and sampling mode, usually the continuous samples Using NI-DAQmx Timing VI (select Use waveform as timing setting). 4. Write the waveform data to DAQ device Using daqmx write VI.

4 (Analog Waveform, 1 Chan NSamp). 5. Start the Signal Generation process Using NI-DAQmx Start VI. 6. Create a while loop and Using daqmx is done VI to check the device status 7. Clear the Signal Generation 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. Lab Procedure Experiment 1, Create a LabVIEW Signal Generation application of function generator: 1. Launch LabVIEW. 2. Create a blank VI. 3. The front panel should have the following controls 2. a. daqmx physical channel control b. Numerical control for amplitude c. Numerical control for frequency. 4. Drop the NI-DAQmx Create Virtual Channel VI in Measurement I/O-> NI-DAQmx to the block diagram and choose Analog output-> voltage.

5 Connect daqmx physical channel control to its physical channels terminal. 5. Drop the Simulate Signal express VI in Express Input to the block diagram and a. Configure the Signal type as sine wave. b. In timing section: i. Set samples per second as 1000Hz ii. Number of samples 10000. Please uncheck the automatic check box iii. Check the Integer number of samples check box. c. Connect the amplitude control to Amplitude terminal d. Connect the frequency control to Frequency terminal e. Drop convert dynamic data type VI (Express-> Signal Manipulation->from DDT) and select conversion type as single waveform. Connect the sine to its input terminal. 6. Drop the NI-DAQmx timing VI in Measurement I/O->NI- daqmx to the block diagram and choose Use Waveform (Analog output) which will determine the sampling frequency based on the input waveform.

6 Connect waveform from the convert dynamic data type VI to the waveform terminal. Right click the sample mode terminal and choose create constant. Select continuous samples . This configures the continuous Generation mood. 7. Drop the NI-DAQmx write VI in Measurement I/O->NI- daqmx to the block diagram. Select analog->single channel- >multiple samples->waveform (Analog Wfm 1 Cha NSamp) and connect the waveform data to the terminal data . 8. Drop the NI-DAQmx Start VI in Measurement I/O->NI- daqmx to the block diagram. 9. Create a while loop and set up shift registers for both task and error cluster from the NI-DAQmx start VI. Add a wait VI (in Timing). and connect 200 to its input.

7 Right click the conditional terminal and create a control named stop. Extract the error status Using the unbundled cluster by name function in Cluster and variants. The output from this function should be OR'ed with the Signal from the stop button inside the loop. This can control the application to stop if any error occurs during the Generation of the Signal . 10. Connect the NI-DAQmx VIs through task in and task out . terminals and error cluster input and output terminals. At the error output of NI-DAQmx Is Task Done VI extract the error status 3. Using the unbundled cluster by name function. The output from this function should be ORed with the Signal from the stop button inside the loop.

8 This can control the application to stop if any error occurs during the Generation of the Signal . 11. Drop the NI-DAQmx Clear VI to the block diagram outside of the while loop. 12. Drop a Simple Error Handler VI in Dialog and user interface to the block diagram and connect the error output of the NI-DAQmx Clear VI to it. 13. Keep the ELVIS unit off. Connect the output of function generator DAC0 to ACH0+ Using connection wires on the prototype board. 14. Enter the following values to the controls a. Frequency: 5Hz (Always choose a value less than 10Hz because some DAQ card cannot handle frequency higher than 10Hz). b. Amplitude: 1V. c. Physical channel: first right click the control and select IO.

9 Naming filtering. Select I/O type as output and click OK. You can now select Dev1/ao0. 15. Launch your data acquisition VI. Run both data acquisition VI and Signal Generation VI. You should be able to collect the generated Signal . 16. Run tests Using different amplitude (less than 5V) and frequency (less than 10 Hz). Experiment 2, Create a LabVIEW Signal Generation application of ECG generator: 1. Save a copy of the previous VI and rename it. 2. Delete the Simulate Signal express VI . 3. Replace it with Simulate ECG Signal express VI . Function palette->User Libraries->Biomedical Startup Kit->DAQ & SIm- >Simulate ECG Signal . a. You can select heart rate (BPM) and add noise by double click the express VI.

10 4. Connect output Data at the Simulate ECG Signal express VI to the input of convert dynamic data type VI . 5. Launch your data acquisition VI. Run both data acquisition VI and Signal Generation VI. You should be able to collect the generated ECG Signal . Experiment 3 (Optional), Create a LabVIEW Signal Generation application of ECG generator Using real ECG data: 1. Save a copy of the previous VI and rename it. 4. 2. Delete the Simulate ECG Signal express VI . 3. Replace the Simulate ECG Signal express VI in the previous VI to Read Meas File express VI . Function palette->Express- >Read Meas File 4. Select File Format as Binary (TDMS). 5. Check Action Ask user to choose file.


Related search queries