Sunteți pe pagina 1din 8

ECE 495/ GECE 595 Advanced Instrumentation & Measurement

LABVIEW 8 AND DATA ACQUISITION


Broad objective Build a virtual instrument (VI) to acquire and process data using NI-DAQ and LabVIEW Specific objectives Configure the NI-DAQ Take data measurements using the virtual instrument Acquire, analyze, and present the data

Background The application called NI-DAQ allows the user to configure the data acquisition. The NI-DAQ is built into LabVIEW 8.0 with the DAQ Assistant Express VI. The DAQ Assistant to configure the data acquisition is shown in Figure 1.

Figure 1: DAQ Assistant The DAQ Assistant allows the user to choose the type of measurement.

Data Acquisition (DAQ)

ECE 495/ GECE 595 Advanced Instrumentation & Measurement Workstation details Your workstation should have the following items: Computer with National Instruments LabVIEW 8 National Instruments M-series DAQ board Voltage probes Voltage sources (e.g. batteries)

Lab procedure The lab procedure consists of the following three parts. Part 1: Configure the DAQ Part 2: Data analysis in LabVIEW Part 3: Generate and analyze samples of simulated data Part 1: Configure the DAQ 1. Create a New VI and save it to the disk as Find Battery Voltage.vi . 2. Place a While Loop on the block diagram. 3. Place the DAQ Assistant inside the While Loop by going to the Functions palette and Express >> Input >> DAQ Assistant. Use the left mouse click to drop this onto the Block Diagram. The NI-DAQ screen will appear. Choose Analog Input from this screen. 4. The next screen allows one to choose the type of measurement. Choose Voltage to make voltage measurements. 5. On the next screen one can select the physical channel on which measurements are being taken. Choose the channel that corresponds to the measurement probe. 6. The screen shown in Figure 2 appears after the initial set up is completed.

Data Acquisition (DAQ)

ECE 495/ GECE 595 Advanced Instrumentation & Measurement

Figure 2: DAQ Assistant Configuration Window 7. Specify the Input Range of the voltage signal as part of Settings. The measurement is more accurate when the range of voltages assigned is close to the range of voltages measured. 8. The Terminal Configuration is set to Differential. The custom scaling is set to No Scale. If the acquired signal requires any scaling one can enter it here. 9. Change the Task Timing selection to Acquire 1 Sample(on demand). Leave the Task Triggering selection as it is.

Data Acquisition (DAQ)

ECE 495/ GECE 595 Advanced Instrumentation & Measurement 10. Click OK and return to the Block Diagram. 11. Press <Ctrl-E> to switch to the Front Panel. 12. Place a Numeric Indicator on the front panel by going to Controls Palette >> Numeric >> Numeric Indicator. Place this anywhere on the front panel. 13. Go back to the Block Diagram. This can be done by clicking on the Block Diagram or pressing <Ctrl-E> 14. Wire the data terminal of the DAQ Assistant to the numeric indicator.

Part 2: Data analysis in LabVIEW 1. 2. 3. 4. Create a new VI and save it to the disk as Analyzing Data.vi. Go to the Block Diagram and create a While Loop with a time delay of 100 ms inside of it. Physically connect the waveform generator or the signal that you wish to acquire to channel 0 on your DAQ device. Place the DAQ Assistant inside the block diagram. Set the Input Range between -5 and 5 volts. In Task Timing select the Acquire Continuously option. Click OK to confirm. For the analysis use the Statistics VI. This VI is found under Functions >> Express >> Signal Analysis >> Statistics or use Functions>>Mathematics>>Prob&Stastics>>Statstics 6. When you place the Statistics VI on the block diagram a screen will appear. Check the Root Mean Squared (RMS) box. This will calculate the RMS value of the sine wave. Wire the data output of the DAQ Assistant to the Signals input of the Statistics VI. Right click on the RMS output terminal of the Statistics VI. Then click Create >> Numeric Indicator. By right clicking on the terminals of VIs, you can easily create indicators and controls for the system. Create a Graph Indicator for the output of the DAQ Assistant in the same manner as the previous step. Your final VI should look similar to Figure 8.

5.

7. 8.

9.

Data Acquisition (DAQ)

ECE 495/ GECE 595 Advanced Instrumentation & Measurement

Figure 8: Block Diagram of Analyze Exercise using a waveform generator Lab Measurements 1. Check the configuration of your system. 2. Run the VI. 3. Read the RMS value returned by the VI. Extra Credit Items Average the readings from a channel over time to create a more accurate measurement

Data Acquisition (DAQ)

ECE 495/ GECE 595 Advanced Instrumentation & Measurement Part 3: Analyze simulated data in LabVIEW 1. Create a new VI and save it to disk as Data_analysis.vi. 2. Go to the Block Diagram and create a While Loop with a time delay of 100 ms. 3. Place a Simulate Signal VI on the block diagram by going to Functions Palette >> Express >> Signal Analysis >> Simulate Signal. 4. The screen shown in Figure 9 will appear. This screen is used to specify the type of signal to be created.

Figure 9: Simulate Signal Configuration Leave the default settings in place. If the settings are different from those in Figure 9, change them to match what is shown above.

Data Acquisition (DAQ)

ECE 495/ GECE 595 Advanced Instrumentation & Measurement 5. For the analysis, use the Statistics VI. This VI is found in Functions >> Analysis >> Statistics. 6. When you place the Statistics VI on the block diagram. Check the Root Mean Squared (RMS) box. This will calculate the RMS value of the sine wave. 7. Wire the Sine output of the Simulated Signal VI to the Signal input of the Statistics VI. 8. Right click on the RMS terminal of the Statistics VI. Then click Create >> Numeric Indicator. By right clicking on the terminals of VIs, you can easily create indicators and controls for the system. 9. Create a Graph Indicator for the Sine output of the Simulated Signal VI in the same manner as the previous step. Your final VI should look similar to Figure 10.

Figure 10: Block Diagram of Analyze Exercise using only LabVIEW

Data Acquisition (DAQ)

ECE 495/ GECE 595 Advanced Instrumentation & Measurement Lab Measurements 1. Check your configuration. 2. Read the RMS value returned by the VI. Lab Report The lab report must contain the following items. State what you have done The VIs created and used. Voltage readings acquired during the lab in a table

Submit one hard copy per team and post one e-copy (account of team leader) to the Digital Dropbox on Blackboard.

Data Acquisition (DAQ)

S-ar putea să vă placă și