Data Acquisition (DAQ) System B.1 Introduction One of the greatest advancements in experimentation has been the use of computers to automatically retrieve data. Generally speaking, a computerized data acquisition (DAQ) system reads sensors that output some kind of electrical signal (often a voltage). The numerical value of the reading is analog (continuous), which has to be converted to a digital reading (a binary number) in order to be processed by the computer. Once converted, the system processes the information, analyzes the data, and saves or presents the results. The components and fundamental principles of these systems will be discussed elsewhere in the class and laboratory. The purpose of this appendix, instead, is to give you a brief, operational knowledge of the hardware and software so that you can use the system quickly. B.2 Hardware The DAQ system used in this class is shown schematically in Figure B.2. The heart of the system is a National Instruments NI-6034E Multifunction DAQ board, installed inside the computer. A connector block (model SCB-68), connected via cable to the DAQ board, provides a convenient place to connect signal wires; also, the board has a built-in cold junction, which is used with thermocouples to read temperature (we will learn how a cold junction works later in the course). To simplify operation further in this laboratory, eight terminals have been mounted to a Plexiglas sheet and wired to the connecting block. Channels 1-4 are thermocouple connections, and channels 5-7 are voltage inputs (Channel 8 is used for digital output, which is not currently used). The system reads these channels using software written in a code called LabVIEW. The software can then be used to present, analyze, and/or save the data. B-1
DAQ board (NI-6034E) quick-connect thermocouple terminals connector block (SCB-68) PC with LabVIEW software voltage inputs/ digital output Figure B.2. Schematic of data acquisition system including terminals, connector block, DAQ board, computer, and software. B.3 Input Signal Ranges and Resolution The NI-6034E DAQ board can be programmed to read one of four ranges of voltages: ±10 V, ±5 V, ±500 mv, and ±50 mv. Each channel can be assigned differently, and the ranges are selected by software prior to the experiment. The choice of input range is important for two reasons. First, if the incoming signal is outside the assigned range, the system will misread the signal. For example, an 11 V signal read in the ±10 V input range will be read as +10 V; the input signal will in effect be cut off. Second, the DAQ system has a fixed resolution: regardless of input range, the system splits the range into the same number of division. As a result, the largest input range, ±10 V, has the largest division size, or the worst resolution. It is therefore best to choose the smallest possible input range to read the input signal, so that the resolution is the smallest possible. The NI-6034E DAQ board we are using in this laboratory has 16-bit resolution. This means that the board converts the analog input signal into a 16-bit binary word that the computer can process, like 0100010001000101. Since each bit can take on one of two values (0 or 1), there are 2 16, or 65,536 possible combinations of bits (ranging from 0 to 65,535). If an input channel is programmed to read a range of -50 to +50 mv, then the smallest division that the board can detect is (100 mv)/65536, or 0.0015 mv. The reading error could then be estimated as plus or minus half the resolution, or ±0.00075 mv. One important conclusion to draw from this value is that readings for this channel in mv should never include more than 4 or 5 decimal places. The channels in this laboratory have been configured via software to allow for different ranges of inputs. These are listed in Table B.1. Some channels have multiple configurations; for example, channel 5 is defined for either ±50 mv or ±5 V inputs. The resolutions of the channel configurations are also listed in the table. For the thermocouple inputs, the resolution of the channel has been determined in C from the voltage resolution and the temperature-voltage calibration of the thermocouple. Recall that the resolution results in only one error; the error due to other sources (such as noise, timing, multiplexing, etc.) will also influence the total error for the measurement. B-2
Table B.1. Channel configurations defined for the DAQ system. Channel Configuration Description Range Resolution CH0 Cold Junction (5V) CJC sensor 5 V 1.5 10-4 V CH1 Type T TC (50mV) Type T thermocouple -270 to +400 C 0.03 C CH2 Type T TC (50mV) Type T thermocouple -270 to +400 C 0.03 C CH3 Type K TC (50mV) Type K thermocouple -270 to +1232 C 0.04 C CH4 Type K TC (50mV) Type K thermocouple -270 to +1232 C 0.04 C CH5 Voltage (50mV) Voltage ± 50 mv 0.0015 mv CH5 Voltage (5V) Voltage ± 5 V 1.5 10-4 V CH6 Voltage (50mV) Voltage ± 50 mv 0.0015 mv CH6 Voltage (5V) Voltage ± 5 V 1.5 10-4 V CH7 Voltage (50mV) Voltage ± 50 mv 0.0015 mv CH7 Voltage (5V) Voltage ± 5 V 1.5 10-4 V CH7 Voltage (10V) Voltage ± 10 V 3.1 10-4 V The voltage range for the T-type thermocouple is 6.258 to 20.872 mv, so the signal input range for these DAQ channels has been set to ± 50 mv. The maximum temperature range for the K-type thermocouple 270 to 1372 C; the reduced range listed has a voltage range of 6.458 to 49.998 mv to be within the DAQ input range of ±50 mv. B.2 Software The software used to operate the DAQ system was written for this laboratory using National Instruments LabVIEW software. LabVIEW is a high level, Windows-based graphical programming language that uses icons instead of lines of text to create applications. The program used in this lab is called THERMAL_LAB.vi, and can be executed by double clicking on the THERMAL LAB.vi icon on the desktop of the thermal laboratory computers. This application can read input signals from any two channels, display the data in graphical and numerical form, and can optionally save the data to a file. The user interface or front panel for THERMAL_LAB.vi is shown in Figure B.3. Figure B.3. Front panel of DAQ program. B-3
The code (or block diagram) for THERMAL_LAB.vi is shown in Figure B.4. This window can be accessed from LabVIEW by selecting Show Diagram from the front panel s Window pull-down menu. The block diagram consists of a series of icons that represent a set of instructions for the computer. These icons are wired together to control the passing of data and the order of execution. Comments have been included to indicate the function of each group of icons. Note that the timing for the execution of the while loop is controlled by the software with a resolution of 1 ms or 1 khz. Software-controlled timing means that error can be introduced by execution of alternate tasks by the computer during data acquisition. For example, running other applications or redrawing the graph by changing scales will introduce timing errors and should thus be avoided. (Note that hardware-controlled timing exists, which would eliminate this source of error; but the programming is more cumbersome.) Further information about programming in LabVIEW can be found in the software documentation provided by National Instruments Corporation. Figure B.4. Block diagram or code for THERMAL_LAB.vi. B-4
Software Instructions 1. Double-click on the file THERMAL_LAB.vi, located on the Windows Desktop. 2. Select the two channels you wish to read. The code limits you to reading only two channels at a time. Labeled Channel A and B, you can choose the appropriate input channel by using the pull-down selection list for each channel, as shown in Figure B.5. Figure B.5. Selection of Channel A input signal. 3. Choose the Sample Rate, Scan Rate and Oversampling. The Scan Rate is the rate at which individual data points are acquired from either input channel. For example, a scan rate of 1000 means that data will be acquired from a channel at a rate of 1000 scans per second. Oversampling is the number of scans per sample; an oversampling of 100, for example, means that 100 data points will be acquired and averages to form one sample. The Sample Rate, then, is the rate at which a set of these averages will be acquired and recorded. Note that oversampling cannot take longer than your sample rate. For example, choosing a scan rate of 100 scans per second and an oversampling of 100 data points requires a full second to perform, for each channel. Therefore it is unrealistic to expect a sample rate to exceed about 2 seconds per sample. 4. Start the DAQ software by clicking the run button ( )at the top left corner of the window. If the file name given on the front panel already exists, a window will appear asking if you wish to replace the file. 5. Data will be displayed as Amplitude versus Data Point in the graph and in the digital display to the left of the legend. The amplitude scale can be changed at any time by editing the upper and lower bounds for the axis. Alternately, you can pan and zoom in or out of the graph using the graphical controls toolbar to the bottom left of the plot, and you can scroll B-5
forward or backward in time (up to 5000 data points ahead or behind) using the scroll bar on the bottom right of the graph. Both of these features are depicted in Figure B.6. You can edit these values, even while running Pan Function Scroll bar Zoom Functions Figure B.6. Graphical controls. 6. To save data to a file, click the button under Save Data. The button will indicate ON, meaning that data is being written to your text file. To stop recording, click the button again. 7. To stop the program, click the stop button at the top of the graph. DO NOT USE THE STOP BUTTON AT THE TOP LEFT CORNER OF THE WINDOW ( ). 8. You should transfer your files to a 3.5-inch disk for transport. You may also transfer your file to your Blackboard account: Begin by starting Microsoft Explorer, then go to my.calpoly.edu, and login to your account. From the Blackboard frame select this course (ME 236), press Student Tools, and then Digital Dropbox. Follow the instructions to upload the file. Use the same procedure to later download the file. B-6