Desktop Data Acquisition Scales New Heights

Today's DA systems include standard hardware and easy-to-use software for any use.

Today's DA systems include standard hardware and easy-to-use software for any use.

By Peter Varhol

 
Desktop Data Acquisition Scales New Heights
Software like MATLAB from The Math Works provides a means of doing engineering analysis on real time data as it comes from an embedded data-acquisition card in a PC.

Data is king. If we can record and analyze it, we can make design decisions based on it. Data acquisition on many different types of systems isn’t technically difficult, but doing it inexpensively, and in real time, can be a challenge. Further, real-time analysis of that data is a prerequisite to system feedback and automated control for a system. Recording the data is one thing; making that data immediately useful is another.Making that happen requires hardware, software, and the ability use them to design and build the data-acquisition components of your system. And thanks to standard hardware and sophisticated software, it’s easier than ever.

  Data acquisition has a very broad range of uses, from collecting data on instrumentation on lab experiments to analyzing manufacturing data and using the results to feed back into the system and improve its efficiency. In all cases, instruments or systems produce a discrete feed of values that must be captured. In some cases, these values need only be stored, but often they have to be analyzed on the fly, and sometimes decisions must be made immediately.

  In the not-to-distant past, high-end computer platforms such as Unix RISC workstations were required to handle large amounts of real-time data and have enough computing power left over to perform control and operator interface functions for data acquisition platforms. It was expensive to do real time data acquisition, and we avoided it unless we could justify the high cost.

  It’s different today. The price for all of the components has dropped dramatically, and it’s easy to integrate them into a working system. Even hobbyists can build data-acquisition systems for everything from collecting and analyzing weather data to better understanding the heating and electrical requirements of their homes. For data acquisition (DA)  professionals, it is almost a piece of cake to build anything but the most complex system for acquiring and manipulating data.

Building Out the Hardware
There is hardware available for just about everything you would want to do in terms of DA. Much of it is PC-based; even if it doesn’t have a card interface, it can typically plug in via USB or RS-232 serial ports. These cards can typically sample analog data across multiple channels,  translate it into digital signal, and make it available as a discrete data stream to the PC.

  A typical plug-in DA card has a sampling rate of 30,000 to 250,000 data samples/second. For faster speeds, the DA card must be able to communicate with the PC computer via direct memory access (DMA). This allows the card to transfer large quantities of data directly to the computer’s memory. Unlike DA systems of the past, these cards can cost anywhere between $200 and about $1500, depending on speed, channels, and other features.

  PC-based DA begins with a PC plug-in card, using the PCI bus or USB 2.0. Other, lesser-used bus interfaces include PCI Express, PXI, PXI Express, wireless, and Ethernet. You simply open the PC chassis, plug in the board (if USB, then plug directly into the external USB port), connect the channel ports of the card to your instrumentation, and you’re ready to go. A typical board configuration might be a 12-bit DA system that provides eight analog inputs, two analog outputs, and 24 digital I/O, all on a single low-cost PC board.

  While a PC plug-in DA board (typically supporting Windows,  Mac, or Linux) represents the most efficient and most economical solution to many DA applications, standalone systems still have more capability and flexibility. While more expensive, these can usually still be interfaced with PCs, providing a high level of features while using standard hardware.

 
Desktop Data Acquisition Scales New Heights
National Instruments’ LabVIEW has made it possible for engineers to build data-acquisition software by visually by connecting data feeds to preconfigured visual readouts.

DA Software
The type of software depends at least in part on the rate of DA required. At the very least, you have to make sure that your operating system can handle interrupts fast enough to process incoming data. For many purposes, Windows or Linux suffices, as the data rates are slow enough to use a common and inexpensive operating system for processing.

  But some processes generate data too fast for a desktop operating system to effectively manage, or they lack the guarantee of being able to capture all of the data. For guaranteed real-time performance, you may have to consider running a real-time operating system such as QNX or Wind River Systems’ VXWorks (soon to be acquired by Intel). There are also real-time versions of the Linux operating system. These operating systems provide predictability in response times, enabling engineers to count on them for demanding systems with strict timing parameters. Many real-time operating systems are capable of running on full PCs, making it possible to use inexpensive off-the-shelf hardware for a platform.

  But then the question becomes one of what to do with the data once it arrives on the PC. Whether you are analyzing or storing it, you need an application running on the PC to grab data from the board and perform some series of actions on it.

  In the past, you often needed software developers to write C or C++ programs that would pull the data from the card, and perform analysis and storage. While that may still be the best approach today, higher level tools such as National Instruments’ LabVIEW or MATLAB from The Math Works offer alternatives that let engineers design and build their own programs.

  MATLAB includes a combination of visual blocks and code to enable engineers to create engineering applications at a high level of abstraction. Engineers can use MATLAB in conjunction with The Math Works’ DA module to build and deploy a complete application to run a DA system, from acquiring the data to integrating it within an enterprise decision management system, if necessary.

  LABVIEW is a full visual programming language, with the ability to use a large and comprehensive toolkit of components in assembling an application for DA, analysis, and integration with more traditional applications. National Instruments, which also makes DA boards and other hardware, combines its expertise in both to deliver end-to-end solutions involving PC-based DA, analysis, and control.

  Why would you want to do any of this? It all depends on your goals. You need software to capture and analyze the data, and both MATLAB and LABVIEW provide ways to write that custom software without dropping down into computer code. Ultimately, they provide the glue that ties together data-driven processes with feedback and decisions necessary to get the most out of those processes.

Putting the Pieces Together
Assembling a PC-based DA system isn’t difficult, although you have to have clear technical goals in mind. First, determine your requirements—the amount and type of data to be processed and stored, the data rate, and the number of channels.

  You also need to consider the importance of that data; if it’s critical for cost or safety reasons to process and store, you have to make sure that your system has appropriate backups and redundancies. You might want a RAID disk array for protecting the data, or a fault-tolerant computer system with multiple processors, controllers, and power supplies.

  Second, identify one or more cards that meet your technical needs. In many cases, the technical parameters of the card have to be evaluated in the context of both the DA requirements and the PC to be used. Note that the choice of PCI or USB 2.0 often isn’t important, unless you need the extremely high input rates available with PCI, or you are using a laptop computer that largely limits you to USB 2.0.

  Third, develop the software you need to process the data. Even though you may be working in a visual language such as LABVIEW, you have to treat it as a software development project, with an understanding of your functional components and how they work together.

  If you don’t have software development expertise, consider doing it within your organization or hire it from the outside, depending on how many DA projects you have, and how many you must support. If the work is regular, you probably want to bring software development in-house.

  Last, don’t skimp on the integration and test of the DA system. Making sure everything works properly once assembled into a system, and the software can handle unexpected and error conditions, is necessary to ensure the robustness of your system. It’s not all plug and play. But with good planning and execution, you can quickly build an inexpensive but sophisticated data-acquisition system.

More Info:
The Math Works
Natick, MA

National Instruments
Austin, TX

QNX Software Systems
Ottawa, ONT

Wind River Systems
Alameda, CA


Contributing Editor Peter Varhol has been involved with software development and systems management for many years. Send comments about this column to [email protected].

Share This Article

Subscribe to our FREE magazine, FREE email newsletters or both!

Join over 90,000 engineering professionals who get fresh engineering news as soon as it is published.


About the Author

Peter Varhol

Contributing Editor Peter Varhol covers the HPC and IT beat for Digital Engineering. His expertise is software development, math systems, and systems management. You can reach him at [email protected].

Follow DE
#6866