Introduction To Data Acquisition System and Labview
Introduction To Data Acquisition System and Labview
Please refer to link “Introduction to Data Acquisition system and LabVIEW ” on SD292 Lab website
before you read the following. The information provided by this link will facilitate the understanding
of LabVIEW software, data acquisition hardware and the terminology that is used in the following.
LabVIEW is a trademark of National Instruments Corporation and the data acquisition hardware we
are using is from Measurement Computing.
With the help of this tutorial you will construct a data acquisition virtual instrument (VI) in LabVIEW.
There are two parts to a VI: the panel and the diagram. The panel resembles the front panel of an
instrument and the diagram is where you make connections with various components.
This VI will acquire the data from a specified channel and display it on front panel. There is no text
programming involved in LabVIEW. The VI when complete should look like the following:
Click to start InstaCal software from Measurement Computing. This is necessary as it would
allow the PC to detect the connected DAQ hardware.
Click on your desktop to start LabVIEW. Click NewVI to start a new VI application.
Front Panel
1. Explore the Controls menu. Choose DIGITAL CONTROL from the Numeric window as
shown in Fig 2. A field will appear on the panel, label it as "Board #".
1. Repeat this 3 times and label them as “Sample Rate”, “Low Channel” and “High Channel”.
These controls will allow us to enter the numeric values for the Minilab1008 data acquisition
board.
3. To plot the acquired data, go to GRAPH menu as shown in Fig 4, select WAVEFORM
GRAPH and label it as Display.
NOTE: With manipulation of G objects, the front panel could look like as shown in Fig. 1.
Figure 5 - Diagram
To change the numeric representation as shown in figure 5., right click on the numeric box and from
the Representation menu change the numeric integer type as shown below:
Hint:
To turn on HELP, from the Help menu, choose Show Help . When the mo use is kept on the any part of
the diagram, a help window will show on the screen. The help for "AInScFg" is shown in Fig 7.
This VI scans a range of AD channels in the foreground and stores the samples in an array.
Note: Enter numeric value 1000 into the constant field. Repeat step 4 and enter value 0.
The reason we are doing this is to provide an input to number of samples to collect and also to
provide an input to t0 (trigger time of the waveform). Please see figure 18 for more information.
5. From the Functions menu select Numeric and choose Ring Constant as shown in Fig 13.
Note: Enter “Not Programmable” text in the first constant field and then enter numeric value
+-10V into the second constant field. To add a second field right click on the box and choose
“Add item after” from the menu and then type +-10V.
The reason we are doing this is to provide an input to the Range. This is used for collecting the A/D
sample. The input voltage range for linear operation, single ended mode for MiniLAB1008 is
±10Vmax.
LabVIEW Tutorial for Data Acquisition 8
6. From the Functions menu select Waveform and choose Build Waveform as shown in Fig 13.
The reason we are building our own waveform is that we need to customize the x-axis scaling. Changing
the X-axis to display Time would help us to visualize the graph in a meaning full manner. Once you
insert the build waveform component drag the middle end to make it look as shown below:
Note: Select the Position/Size cursor from the Tools palette in order to drag and increase the middle
end.
The help for "Build Waveform” is shown in Fig 15.
For any Function or sub-VI the inputs to it are always to the left and the outputs are always to the
right.
To look at all the connections, go to the Help menu and choose "Show Help". With Help turned on, as
you move your editing tool on a function/sub-VI the help screen will pop up. The entire screen
captures in this document are from the "Help" screen.
When the tool is placed over a function or a sub-VI, the terminals on the functions light up with
the connections highlighted. This makes it easy to connect the wire to appropriate terminals.
If the connections between two functions/sub-VIs are incompatible, then a dotted (-----) line will
appear between the connections rather then a solid line. This means that the wire connection is
carrying incompatible data (e.g. an array to a number or a cluster to an array). Check the connections
again with the "Help" screen or by looking at Fig 18.
Using the wire tool , connect the appropriate controls to the sub-VI as shown in Fig 18. Connect
the graphing indicator on towards the end of your construction. When your implementation is
complete, the tool bar will show the status of the VI. As said before if a connection is bad or is not
appropriate, it will show on the diagram with a broken line. If the terminals are not connected
appropriately, the tool bar will display the status as shown in Fig 17.
After connecting all the wires as shown above, proceed to the front panel and fill in the appropriate
information on the front panel as described below:
Low & High Channel as 0 for Channel control. Adjust your function generator to output 100 Hz, 2v p-
p sine wave signal
Depending on the frequency of the input waveform, enter an appropriate sampling frequency number.
The number that you enter should be at least twice the frequency of the input waveform.
In the Count, put the same number as the Sample rate.
After entering the appropriate information, click on the to begin acquiring data.
If the information entered was correct the collected signal will appear on the front panel.
As you may have noticed, the data acquisition is done only at the time of clicking
To do a continuous data acquisition, follow these steps:
Click on and the data acquisition will continue until STOP is pressed.
Show your first VI to the lab instructor. Save the VI on your Nexus drive.
To Access your nexus drive (N drive) type \\ecfile1\<username> in Start -> Run-> field