Lab 5: Data Acquisition Lab Pre-Lab What are the four main

advertisement
Lab 5: Data Acquisition Lab
Pre-Lab
1. What are the four main components of a generalized measurement system?
2. In LabVIEW , which window is used for writing the program or source code and which
window displays the input and output controls?
3. What do thermocouple and RTD measure? Which component does it represent in the
measurement system?
4. What is the name of the data acquisition module used in this lab?
Data Acquisition Lab
(Read Experimental Methods for Engineers, Seventh Edition, Holman, McGraw-Hill, 2001,
pp.579-604.)
Objective:
The purpose of this lab is to introduce the students the basic principles of data acquisition system. The
use of LabVIEW Graphical Programming language will be introduced.
Introduction:
The introduction covers two big areas of study: data acquisition and LabVIEW graphical programming.
Both of these areas require an entire book each to thoroughly study the topic. The short introduction will
allow you to take simple measurements.
Data acquisition system
The instrument measurement system combines hardware (instrument, data acquisition system (DAS) and
computer ) and software to collect data, process, and record result in a form suitable for storage,
presentation or additional subsequent process. Figure 1 depicts a generalized measurement system.
Data acquisition begins with the measurand which is the physical quantity, property or condition that the
system measured. This physical quantity could be temperature, displacement, pressure, or force. The
measurand is measured and converted into an electrical signal such as voltage, current and resistance by a
transducer. The output signal from the transducer is not always suitable for the data acquisition (DAQ)
hardware to process. Therefore, signal from the transducer is passed to a signal modification system for
signal conditioning and conversion. Signal conditioning may include bridge completion, amplification,
and filtering. Results from the signal modification system are then transmitted to an output device such as
an oscilloscope, indicator, or computer for display, storage, or additional processing.
Data acquisition system (DAS) uses a combination of computer-based measurement hardware and
software to provide the measurement system. The DAQ hardware performs the interfaces between the
signal from transducer and the computer. It can be in the form of modules that can be connected to the
computer’s ports (parallel, serial, USB) or cards connected to slots (PCI, ISA) in the mother board. The
driver software usually comes with the DAQ hardware. The software sets up the computer to recognize
and configure the DAQ hardware so that signals can be read by the DAQ hardware, accesses and records
the data. Figure 2 shows the basic operation of the DAS and the measurement system or computerized
data acquisition system.
The multiplexer allows sampling of multiple experimental variables using different transducers. The
computer controls the order of sampling of signals coming from the MUX. It samples one analog
(continuous) input and holds the data for a short time (Sample and Hold) before sending the data for
analog-to-digital conversion. Doing this prevents sampling from the wrong channel as well as allowing
time for the analog-to-digital converter (ADC) to convert the signal to digital format. The computer
cannot read analog signals. The digital data are stored temporary in a buffer. When the buffer is full, the
data are pulled out and stored in a different location (memory) of the computer. This allows the buffer to
continuously accepting measurement data.
LabVIEW Graphical Programming
Traditional computer programming involves writing down a list of instructions for the computer to
execute in sequential order. Each instruction depends on the data available from the last instruction.
LabVIEW uses blocks to specify each operation and connects the blocks with wires to show the data
dependencies. As an example, Figure 3 shows the operation of multiplying two numbers and displaying
the result. LabVIEW is a window-based system. The program is in one window and the inputs and
outputs appear in a separate window. The programming window is called the Block Diagram window
(right picture of Figure 3). The Front Panel window (left picture of Figure 3) displays the inputs and
outputs controls. The two boxes on the Front Panel (labeled A and B) are input controls. The numbers in
boxes A and B are entered by the user of the program. The box labeled product of A and B is the output.
Therefore, the Front Panel is set up a lot like a regular instrument panel such as a calculator.
Figure 3: Left: Front Panel shows the set up of two number inputs and display the product of these two
numbers. Right: Block Diagram window shows the corresponding program (equivalent to source code of
traditional programming).
Materials:
LabVIEW Graphical Programming Language Version 7.1, National Instrument data acquisition module
PX1-6070E, NI SC-2345 Signal conditioning with configurable connectors, NI Thermocouple Block
SCC-TC02, NI RTD Block SCC-RTD01. T-type thermocouple, and a Platinum resistance temperature
device (RTD).
Procedure:
Before you do any data acquisition, you need to familiarize the software that controls the DAS. The
software is the LabVIEW Graphical Programming Language. The first part of the lab is to write a simple
program using LabVIEW to generate a random number between any two numbers. The second part is to
use LabVIEW to acquire temperature data from a thermocouple and a RTD.
A. Write a program in LabVIEW to generate a random number between any two numbers.
Note: The flow of the blocks in the program is from left to right (input, calculation, output).
Therefore, the wires are connected from the right side of a block to the left side of the next block in
the programming order.
1. On the computer, double-click LabVIEW, click New, Blank VI. The Front Panel (gray with grids)
appears on the front. Now click on the Block Diagram window (white background) or go to
Window, Show Block Diagram.
2. Display the menu for Functions Palette and Tools Palette by going to View  Functions Palette
View  Tools Palette.
3. On the functions palette, click on the Execution Control icon (looks like a square), then drag the
While Loop (first one with a red cross at lower right hand corner) into the diagram window.
4. Make the while loop larger by dragging the corners. Notice that a stop button is shown on both
the block diagram and front panel.
5. From now on, all program components are to be placed inside the while loop. Obtain the
random number generator by going back to the Function Palette, then select (double down arrow),
Mathematics, Numeric (first one), random number (0-1). It is the icon with a pair of dice. Drag
the random number generator inside the While loop.
6. Go to the Front Panel window. You will need to have controls for inputting the upper and lower
limit for generating random numbers between these two values. A graphical display is also
needed to display the numbers.
7. To obtain an input control, from Controls Palette, select Numeric Ctrls  Numeric Ctrl. Drag the
Numeric Ctrl onto the front panel. We need two of these. The Numeric Ctrl displays a label and a
box for entering data. Erase the text in the label and type in “Upper Limit” in the first numeric
control. Rename the second input control "Lower Limit".
8. Now, go back to the Controls Palette, click Express, and select Graph Indicators, and drag the
Waveform chart (first symbol on left) onto the front panel window. Rename the chart as Scaled
Data.
9. You will also need a numeric output indicator. Go to Controls Palette  Numeric Indicators 
Numeric Indicator and drag the indicator to the Front Panel.
The equation for getting the random numbers between two values (upper and lower limits) is:
Output = Random x (Upper Limit – Lower Limit) + Lower Limit
So you need the operators for addition, subtraction, and multiplication. These are in the Block
Diagram Window.
10. Go to the Block Diagram window, Functions PaletteMathematicsNumeric. The operators are
triangular in shape with the addition (+), subtraction (-), or multiplication (x) sign inside.
11. Connect the elements using the wire tool (looks like a spool of thread). Connect from the right
side of a block to the left side of the next block. The output of the calculation is connected to the
Waveform chart.
Your program should be similar to the following:
12. Save the program. Go back to Front Panel; set the upper and lower limit using the “A” Tool.
Click  and hit run (fat upper arrow). After a few seconds, hit the STOP Button to end the
execution. The graph should display the values between the upper and lower limits.
13. Demonstrate your program to the instructor before proceeding to part B.
B. Write a program to read temperature data from a thermocouple (TC) and a RTD.
1. The physical connections of all the components of the measurement system are completed by
the instructor. You can check the connections as described below:
A T-type thermocouple and a RTD are connected to their signal conditioning unit. The units
(SCC-TC02 for TC and SCC-RTD01 is for RTD) are housed in junctions 1 and 3, respectively,
of the SC-2345 Signal Conditioning with Configurable Connectors box. A black cable
connects the SC-2345 to the data acquisition module PXI-6070E in slot one or dev 1 of PXI1000B. A cable (blue) connects the PXI -1000B to the computer. A power supply is provided
to the SC-2345 (next to the cable to PXI-1000B).
2. On the Start Menu, start the MXI-3 Optimization program. This allows LabVIEW to check
for physical drives for data acquisition.
Check that J1 has the TC block and J3 has the RTD block. This screen is where you can
reconfigure the type of modules and blocks on the data acquisition card.
3. Double-click Measurement and Automation on the Desktop and the the configuration window
will appear. Expand the Devices and Interfaces directory NI-DAQmx Devices SC2345:SCC1. The configuration screen displays on the right and shows the name of devices
and instruments connected to the system. Close the window.
4. On the Start Menu, start the LabVIEW program and select Blank VI to start writing the data
acquisition program.
5. On the Front Panel, obtain 4 numeric indicators (Controls Palette Numeric Controls
Numeric Control). Two of these will be for displaying the mean temperature from a TC and
RTD and the other two will be for standard deviation. Rename the indicators accordingly.
6. Obtain a Waveform Graph (Controls Palette Graph Indicators Waveform Graph).
7. On the Block Diagram window, go to Functions Palette NI Measurements DAQmx-Data
Acquisition to retrieve the DAQ Assistant.
8. Double-click the DAQ Assistant on the Block Diagram window to configure the settings for
the TC and RTD. Follow the following steps to get to TC setup screen:
Analog InputTemperatureThermocoupleSCC1Mod1(SCC-TC02)click box with
"+" to select ai0. Next click finish.
Once the TC setup screen appears (shown below), enter
Thermocouple Type: T
CJC Source: Built In
Acquisition Mode: N Samples
Samples To Read: 25
Rate(Hz): 1000
9. DON’T click OK yet! Go to Add ChannelsRTDSCC1Mod3(SCC-RTD01)ai0OK.
The RTD setup screen displays as shown below and enter
RTD type: PT 3851
Configuration: 3-wire
Iex Source: Internal
Iex Value (A): 1m
10. Click Test (check mark) to test for proper setup. Then click OK.
11. We need to display the data collected from the DAQ Assistant as a Waveform Graph and
calculate the mean and standard deviation from the TC and RTD and display the numbers. To
obtain the icon to calculate mean and standard deviation, go to the Functions palette and select
MathematicsProbability & StatisticsStandard Deviation & Variance. We need two of
these.
12. Use the wire tool to connect the Data terminal of the DAQ Assistant to the first Standard &
Variance icon (left side). A Dynamic conversion icon (DTT) appears (orange color) between
the two connections. The DTT converts the data from the DAQ Assistant to a numeric value.
Right-click this DTT icon. On the screen, select 1D array scalars-single channel, and set
channel to 0. Click OK. This puts the TC temperature data into a column.
13. Now connect the mean output (next to ) to the TC mean temperature display box and connect
the standard deviation terminal (next to ) to the TC standard deviation display box.
14. Use the wire tool to connect the Data terminal of the DAQ Assistant to the second Standard &
Variance icon (left side). A DTT icon appears (orange color) between the two connections.
Right-click the DTT icon and select Properties 1D array scalars-single channel, and set
channel to "1". Click OK. This puts the RTD temperature data into a column.
15. Now connect the mean () terminal to the RTD mean temperature display and standard
deviation () terninal to the RTD standard deviation display.
16. Connect the Data terminal of the DAQ Assitant to the Waveform Graph.
17. We would also like to save the data into a file for later anaylsis. Go to Functions palette All
FunctionsFile I/OWrite LabVIEW Measurement File. A setup screen is activated. On the
screen, select Ask User to choose file and Overwrite file, and click OK. Connect the Data
terminal from the DAQ Assistant to the Signals terminal of the Write LabVIEW Measurement
icon.
Your program should be similar to the following:
18. Save the program. Then go to the Front Panel window and run the program. The graph
should show two traces with Amplitude already corrected for temperature in oC with the means
and standard deviations displayed for both sensors.
19. Demonstrate your program to the instructor.
Lab Report: No formal lab report.
Hand in title and answer the question below.
1.
You know how to configure the DAS for a thermocouple and a RTD. Now suppose we were to
remove the RTD block and put a second thermocouple block in the same junction. Like the first
thermocouple, the second one is also a T-type thermocouple. How will you reconfigure the
computer to read the second thermocouple? Just rewrite the steps that require changes (highlight
the changes in BOLD). [Hint: start from step 3 of part B]
Download