You are on page 1of 6

Introduction to the DAQ system and LabVIEW Introduction: Electric signals are generated by transducers, which is analogue.

Since transducers are analogue, output varies continuously over range of inputs. Computers are ideal instrument for monitoring and controlling electric signals. However, as computer is digital, electric signals must be converted to digital first. Data Acquisition (DAQ) is the process which turns analogue electric signals into digital; it takes samples of continuous signal and converts it into digital value. However, DAQ has problems such as resolution, conversion rate, conversion errors and noise. These errors should be considered determining the accuracy of digital representation of a continuous signal. DAQ consists of two main parts, signal conditioner and A/D converter. A signal conditioner is used to filter and amplify the analog signal. The signal is then digitized by Analogue-to-Digital (A/D) converter. A/D converter converts analog signal by converting conditioned voltage into digital number corresponding to number of bits. Graphically, input range of the converter represents the horizontal axis. The voltage in this range of input are split up into discrete levels on the vertical axis. (The total numbers of levels are related to the number of bits) This is a process converts the continuous quantity to a discrete digital numbers. So, accuracy of the conversion is correlated to digital resolution.

LabVIEW is software that record and analyze the data by allowing the user to build virtual instruments (vis) such as oscilloscopes and digital voltmeters. Main purpose of this experiment is to introduce the measurement of electric signals using DAQ and to become familiar with the LabVIEW software and the Data Flow paradigm.

Equipment provided: One function generator One dual-trace oscilloscope Connecting BNC cables One BNC T A back panel with a signal conditioner with a gain of 1

Hypothesis: Part 1 1. Log into the university EMF network using McGill username and password 2. Open LabVIEW from the program list. Write a new program called virtual Instruments in LabVIEW. Create a Blank VI 3. The grey window is the Front Panel and the white window is the Block Diagram. LabVIEW uses the Data Flow programming architecture which consists of drawing figures that create dependencies among the data. 4. Use File >> Save as and save your V 5. Click on the Block Diagram. Right click on the white board for the functions palette 6. Go to Programming >> Structures >> While Loop and place the loop on the white board 7. Enlarge the loop to cover the entire window. 8. From the Functions palette go to Programming >> Numeric >> Random Number (0 1) and place it inside the loop 9. Press Ctrl-H to open the Context-help 10. Go back to the Front Panel and right click to get the Controls palette. Go to Modern >> Graph >> Waveform Chart and place it on the Front Panel. 11. Double-click on the title Waveform Chart and type Scaled Data 12. Right click on the chart, then click on visible Items >> Digital Display 13. Display can be repositions by dragging it 14. Right click again on the chart and click on Find Terminals. The block with DBL written on it represents the digital display 15. Bring the cursor to the random number generator and when you see the wiring spool, click and connect the random number generator with a wire to the display.

16. Insert the condition to run the while loop. Go back to the Front Panel and right click to get the Controls palette, go to Boolean and choose the STOP button. Place it on the Front Panel. Right click on the button again and choose Find Terminals. 17. Connect the STOP button to the input of the while loop which is yellow little square with the circulation symbol 18. Save the file and test it by pressing RUN button on the task bar. Highlight execution button demonstrates how circuit works 19. Go to the Front Panel and observe how the program works 20. Modify the program to scale the numbers of the random number generator between an upper limit and a lower limit. OUPUT = [Random Number x (Upper Lower)] + Lower 21. To implement these operations, input two numbers and import the necessary functions. Right click on the Block Diagram and go to Programming >> Numeric and get the Multiply, the Subtract and the Add function. 22. Go to the Front Panel and from the Controls palette go to Numeric and get two Numeric control. Place them on the Front Panel of VI and label them Upper Limit and Lower Limit. 23. Go to the Block Diagram and use the Help (Ctrl-H) to understand how these blocks work 24. Save the file and test it as follows. Go to the Front Panel and change the setting of the Upper and Lower limit to 7 and - 5. Test the program with different values and highlight the execution sequence on the block diagram. Write all the observations and conclusions 25. Write the group number on the Block Diagram and Front Panel. From Front Panel go to view >> Tools Palette. Choose the large A from the Tools palette. Click on the Block Diagram or Front Panel and write the group number 26. Obtain a printout of the program. Part 2 1. Re-save the file as Graphic Digital Oscilloscope.vi Open the new saved file. Modify the program read, digitize and manipulate an actual electrical signal created by a function generator 2. Use VI blocks to accept data from the DAQ system. Right click to open the Functions palette and go to Measurement I/O >> NI-DAQmx and place the Read and Timing blocks inside the loop. The Read block has instructions to acquire analog signals from the DAQ hardware inside the computer. The Timing block allows for control of the sampling rate. The DAQ hardware is connected through a flat cable to a Back Panel. 3. Right click to get the functions palette. Click on Measurement I/O >> NI-DAQmx >> Const. Drag a global Channel onto the Block Diagram. Wire the Global Channel to the tasks/channel in terminal of the Timing block. Drop the arrow on the Channel Const, click on Lab2. Also wire a control to the rate control terminal on the Timing block. This control is used to set the sampling rate in Hertz. The Read block will need the

4.

5.

6. 7. 8.

task information too. Wire the task out terminal on the Timing block to the task/channel in terminal on the Read block. Connect the blocks together such that data from DAQ is output to the waveform chart. On the Read block drop the arrow on the white box and select Analog >> Single Channel >> Single Sample >> Waveform. Wire the data terminal on the Read block to the waveform chart. Virtual oscilloscope must also have capability to scale the displayed voltage and add a vertical offset to the displayed signal. These operations are similar to the Volts/div and vertical position knobs on an analog oscilloscope. Add these functions to the program. Wire in two digital controls and as many operation blocks as needed to modify the signal output from the Read block to scale and vertically shift the signal before it is displayed. Label the controls Scale Factor and Vertical Position. Turn on the Function Generator, the oscilloscope and the Back Panel. Set the Function Generator to give a 3 Hz, 1 V peak-to-peak sinusoid. Set the Sampling Rate to 1000 Hz and start the program. Verify that you obtain the same waveform in LabVIEW. Test the program by changing the settings. Change the Scale factor to 5 and the Vertical Position to 0, and then run the program. Print the block diagram and output

Part 3 1. Start with a sampling rate of 1000 Hz. Take note of the Scale and Vertical Offset control values in the LabVIEW program 2. Dial in a 1 V Vpp, 3 Hz sinusoidal signal on the function generator. Verify that the signal shown on the waveform chart in the program is identical to that obtain on the oscilloscope 3. Find the input range of the A/D converter. Increase the amplitude of the signal until voltage cut-off can be observed and stay high then stay low at constant values. The straight lines obserbed in the waveform are caused by the A/D converter saturating at its upper and lower limit. These lines represent the maximum and minimum digital counts used in the A/D conversion. Take note of these values. 4. The digital resolution is the smallest change in voltage that can be digitized by the system. Lower the amplitude to very low voltage, below 10 mV Vpp toward 0 V Vpp. Rescale the waveform chart using the Scale factor control. It can be observed that the signal displayed on the waveform chart will transition from a continuous waveform to one that has a step-wise appearance. The waveform on the oscilloscope will remain continuous even thought this transition has occurred in LabVIEW. The steps in the signal are the discrete levels which separate the igital counts in the A/D converter. Take note of the resolution. 5. The DAQ systems ability to accurately digitize and reproduce continuous waveform can also be limited by sampling rate. So that the signal is not limited by digital resolution,

increase the amplitude of the 3 Hz sinusoidal signal so that it is just below the saturation cut-off limit. Now, lower the sampling rate in increments monitoring the signal on the analog oscilloscope and LabVIEW. At what sampling rate does the DAQ no longer adequately reproduce the signal?

Results and discussion: 1. Input range and resolution of the A/D converter are -5 to 5 and 25 mV respectively. and Therefore, .

A/D Converter
10 9 8 7 6 5 4 3 2 1 0

Graph above does not look like Figure 2.1 in the introduction as horizontal axis is divided into 402. (Discrete levels cannot be seen as horizontal axis is too small)

-5 -4.6 -4.2 -3.8 -3.4 -3 -2.6 -2.2 -1.8 -1.4 -1 -0.6 -0.2 0.2 0.6 1 1.4 1.8 2.2 2.6 3 3.4 3.8 4.2 4.6

2. Since Vo = GVi, maximum gain that can be applied to the 1 V peak-to-peak signal is 10. Maximum gain is 10 because if G was any higher, output voltage will be higher than the cut-off voltage of 10 Vpp. Resolution of the system would be at its maximum resolution as signal has been amplified as much as it can before it was converted to digital. Therefore, new resolution of the system will be 25 mV. (Lowest resolution recorded by the LabVIEW, part 3 #4 of the experiment.

You might also like