labview assignment 2.2
TRANSCRIPT
8/10/2019 Labview Assignment 2.2
http://slidepdf.com/reader/full/labview-assignment-22 1/5
Task 1 (80%)
Your task is to build a Virtual Instrument in Labview that can measure a discrete component and
identify the type of component (resistor, capacitor or inductor) and measure it’s value.
You will use the NI ELVIS II board as a DAQ, but must not use the NI Elvismx Instrument Vis withinyour program.
Your program should guide the user through the device measurement process and display the
results accordingly. This should indicate the measured value (scaled appropriately) and the units.
Your program should demonstrate the use of the following programming methods:
• A state-machine
• MathScript
• Event-driven programming
• Error-handling
My first task is to set up the Elvis board as a DAQ and link it to my Project, I open a new VI from the
Labview homescreen and select Tools > Measurement and
automation explorer.
We are now taken to the menu shown on the left, we connect
our Elvis board to our Computers
via a High speed USB cable and
then left click on Devices and
Interfaces
Now we can select Our DAQ device from the drop down menu
shown, Once selected a green indicator will appear to confirm
our devices selection.
We then right click on Data Neighbourhood and select create new > NI-DAQmx Task > Acquire
signals > Voltage and select our channel pin we will use on our Elvis board, we repeat this step forgenerate signals.
Now we can move onto building our block diagram, My first step was to add 2 DAQ assistant VI’s;
one to aquire signals and one to generate signals. The DAQ assistant VI’s give us the ability to create,
edit and run tasks using NI-DAQmx, I then labelled my 2 DAQ assistants Input and output, shown
below
8/10/2019 Labview Assignment 2.2
http://slidepdf.com/reader/full/labview-assignment-22 2/5
On the DAQ assistant Input VI we will later need to add a constant number of samples and a
constant rate; Number of samples designates a specified figure to the task the VI is assigned to and
Rate specifies a sample rate ion samples per channel per second. We also have to set the Error in
function to describe any errors that may occur when trying to run the VI, this information will then
be sent out of the VI via the data point, firstly to a waveform graph which will be displayed on our
front panel and secondly to our next VI which needs to measure the data.
Now I can set up my wiring on the Elvis board, I am going to have a 4v supply, a 1kΩ resistor,then
either a 100nf capacitor/ 987Ω resistor or an inductor as well as my input and output signals and a
return to ground. My wiring is shown in the picture below set up with the 100nf capacitor.
8/10/2019 Labview Assignment 2.2
http://slidepdf.com/reader/full/labview-assignment-22 3/5
My next step is to find a way of measuring the signals I will be sending, I chose to use the Tone
measurements VI; this gives me the ability to read the signals being sent from the Elvis board and
show the data on indicators, in this case I need to show the amplitude and frequency as shown
below. These indicators will also be displayed on the front panel alongside the previously installed
waveform graph.
We need to now use a Labview add-on called mathscript node, this gives me the ability to add in
calculations specific to the tasks I am undertaking, I can add constants and controls to the mathscrpit
node to set the actual figures and then send out the data to indicators and graphs on the front panel
as well as sending out the data to other areas of my project.
The mathscript node shown above uses the information I have set as a constant to generate a
waveform on an XY graph on the front panel using the formula X = A*Sin(2πFt)
We next need to add a second mathscript node, this Node will need to be placed within a series of 2
case structures, this is because we want to read two separate measurments, when the case
structure reads true we will use the mathscript node shown below
8/10/2019 Labview Assignment 2.2
http://slidepdf.com/reader/full/labview-assignment-22 4/5
The equation used in the mathscript node gives me the ability to generate a capacitor value, the
equation derives from the capacitive reactance equation
As we need to find C we transpose the equation to give us
Our value will be displayed on the front panel and will let us know which size capacitor we are
measuring across on the Elvis board.
My first attempt at using the mathscript node to measure my reading was unsuccessful, I was using a
987Ω alongside my 1kΩ resistor but my readings were giving me the wrong size resistor value
8/10/2019 Labview Assignment 2.2
http://slidepdf.com/reader/full/labview-assignment-22 5/5
Task 2 (20%) [words: 800-1000]
Your second task is to explain the need for advanced analysis tools (such as Labview) within
engineering. You should include examples of how they are used and describe the benefits they
offer.
There are many different types of advanced analysis tool on the market and they perform countless
different tasks between them, one thing that they all have in common is the ability to convert
scientific facts and figures into an action. Many of these tools are written in programming languages,
National Instruments Labview uses what a language known as G ; a dataflow programming language
which is slightly different to the more archetypal programming languages used by electrical
engineers as NI have given the user the ability to build the language in the form of a circuit rather
than a combination of written commands.