Reader small image

You're reading from  Data Acquisition Using LabVIEW

Product typeBook
Published inDec 2016
PublisherPackt
ISBN-139781782172161
Edition1st Edition
Right arrow
Author (1)
Yik Yang
Yik Yang
author image
Yik Yang

Yik Yang  is a test engineer living in Chicago who has specialized in automation and data analysis. Having worked in multiple fields such as semiconductor, automotive, and power, he has experience with different types of automation and understands what are the industries' needs.He started his career after receiving his Bachelor's and Master's degrees in Electrical Engineering at Virginia Tech. In his career, he worked on automation projects that used CompactDAQ, PXI, FPGA, and so on in LabVIEW. He has also spent a lot of time with Lean Six Sigma and statistical analysis with JMP. He is a certified Professional Engineer (PE) in North Carolina and a Certified LabVIEW Developer (CLD).
Read more about Yik Yang

Right arrow

Chapter 6. Real-World DAQ Programming Techniques

We are almost halfway through the book and we have mostly talked about real-world phenomena and how we are able to use a series of VIs to quantify and represent a given real-life phenomenon (such as temperature, voltage/current movement, and so on) and classify and quantify them with numbers or values understandable to a computer. In doing so, we have been concentrated on getting one action done, but have ignored the real thinking processes and methods required just prior to running that certain VI and all work that must be done after running our main VI, when the objective of a program is a complete working system.

In other words, what we have done so far here is prove the concept. While in real-life conditions, a system (consisting of both software and hardware must stand on its own merits and results), and inputs and outputs of it must be repeatable, documentable, and generally understandable by a peer or a colleague. Even what we are working...

Using event manager


Event managers are triggered by external events; depending on the event triggered they do one or several tasks. Usually, the tests are limited in size while the operator is required for the duration of the task.

Installing LINX


The installation of LINX (http://sine.ni.com/nips/cds/view/p/lang/en/nid/212478) is a much improved path to support embedded platforms such as Arduino, ChipKit, and even National Instrument's own myRIO. Once LINX is downloaded and installed onto LabVIEW, under the main menu item Tools, submenu items, similar to the following screenshot, will be visible. Using LINX Firmware Wizard... will present developers with simple and easy to follow instructions to complete firmware installation.

Note that the LabVIEW function pallet for Arduino must be installed, just like any other tools package using JKI VI Package Manager before one can take full advantage of this platform.

The following image on the left depicts the first screen with multiple drop-down menus that guide the user to install the required firmware. Note the drop-down menus from which one can select Device Family, Device Type, and Firmware Program Interface.

The screenshot on the right illustrates the LINX top-level function...

Acquiring distance measurements using Parallax USR with an Arduino


Acquiring the precise distance to or from an object is entrenched in so many devices we use these days that we often wonder how people used to live without them just a few years ago. From every cell phone that we use, to driverless cars that are now coming to streets, measuring proximity to a nearby object plays a pivotal role in engineering and data acquisition. A robot vacuum cleaner traverses living rooms and bedrooms avoiding objects while cleaning carpets and floors. Modern TVs understand and respond to hand gestures. Defining and recording the exact position of an object in space and its position relative to its neighboring objects has evolved very rapidly.

Even laser gun slinging exploding robots in movies need to measure distance to an object and move accordingly. Not all of that is Computer Generated Graphics. Acquiring the precise distance to an object ranges from a very simple number to extremely complicated GPS...

Duty cycle and PWM


Pulse-Width Modulation, or PWM,  basically creates a pseudo analog voltage. In reality, PWM is a square wave where the percentage of the time where the signal is up versus the time the signal is down, called the duty cycle is varied, therefore and in effect one would get a variable voltage. In the following example, we will create a variable duty cycle; using the PWM capabilities of an Arduino compatible device called Uno32. This board is officially called "chipKIT Uno32 Prototyping Platform" and it is based on Microchip® PIC32MX320F128 and an original Arduino development environment. National Instrument is the parent company of Digilent®, the original manufacturer of this board. The board runs at 80 Mhz, but it has a 32 bit MIPS processor. As mentioned previously, the real signal produced is a square wave and to see the actual waveform we will connect the output to an oscilloscope.

Connections

Note that the Uno32 is Arduino-compatible; as such it must have proper firmware...

Simultaneous data acquisition - NI DAQ and the Arduino Uno


Data acquisition is in fact meaningless without the proper interpretation of acquired data. As stated at the beginning of this book, data acquisition consists of converting a real-life phenomenon into computer-understandable and human-interpretable data. When we acquire a temperature using a sensor and a DAQ, at one point or another we are converting a voltage (or a current value) into a temperature as adegree. In this process, a sensor that is calibrated within a given specification and accuracy range is connected to a DAQ, which in turn converts the received data (as an input) and communicates the output to a software that ultimately presents it in a human-understandable form; not to oversee the accuracy of the DAQ and the software representation.

What we do in real life is measure the accuracy of a sensor, a measuring device, or a DAQ in our system against another one, that we have more data for and trust more.

In the following...

Summary


While traditional DAQs have played a detrimental role in the field of data acquisition, in recent years we have seen a surge of products that not only have surpassed in functionality and availability what was considered to be top-of-the-line just a few years back, but they also have added much more functionality at a lower price.

Among these newcomers, one family of products that has clearly gone above and beyond is the Arduino and Arduino-compatible boards and shields.

Digilent, which was recently acquired by National Instruments, produces higher-end boards compatible with the Arduino family of products. Although they are mainly produced to be utilized as microcontrollers, the fact of the matter is that they not only pack the capabilities of a DAQ, but they also bring many more functionalities that eliminate the requirement for extra hardware to complete a given job. We have examined serial communications, voltage manipulation, analog digital inputs and outputs, PWM, and an example...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Data Acquisition Using LabVIEW
Published in: Dec 2016Publisher: PacktISBN-13: 9781782172161
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Yik Yang

Yik Yang  is a test engineer living in Chicago who has specialized in automation and data analysis. Having worked in multiple fields such as semiconductor, automotive, and power, he has experience with different types of automation and understands what are the industries' needs.He started his career after receiving his Bachelor's and Master's degrees in Electrical Engineering at Virginia Tech. In his career, he worked on automation projects that used CompactDAQ, PXI, FPGA, and so on in LabVIEW. He has also spent a lot of time with Lean Six Sigma and statistical analysis with JMP. He is a certified Professional Engineer (PE) in North Carolina and a Certified LabVIEW Developer (CLD).
Read more about Yik Yang