Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

NI Wi-Fi DAQ Under the Hood: Streaming Reliable Wireless Measurements

3 ratings | 3.67 out of 5
Read in | Print | PDF

Overview

Wireless is everywhere – from home networking to mobile phones, it has changed the way the world communicates and shares data. The increased flexibility and cost savings associated with wireless technology continue to drive widespread adoption in many applications, including test and measurement. Yet for all its technological advances over the past several years, wireless is still not the same as wired. For example, you have likely dropped a cell phone call in the last month, but when was the last time you dropped a “land line call” (if ever)? For most applications, the occasional “dropped call” is an acceptable trade-off for the many benefits that wireless technology delivers. But can the same be said of data acquisition?

To make wireless a viable technology for data acquisition, National Instruments has developed Wi-Fi DAQ streaming technology that is capable of reliable, continuous waveform acquisition over an IEEE 802.11 network. This paper provides an in-depth discussion of three key technologies that make NI Wi-Fi DAQ a reliable platform for wireless data acquisition.

NI-DAQmx for Wireless Data Acquisition

After more than 20 years of helping engineers and scientists achieve high-quality PC-based data acquisition, NI-DAQmx driver software continues to be the heart of the National Instruments data acquisition platform. NI-DAQmx significantly simplifies the most common data acquisition tasks with the interactive DAQ Assistant and still provides low-level access to sophisticated timing and triggering functionality through the NI-DAQmx API. You can program an NI data acquisition device using NI LabVIEW and LabWindows™/CVI; ANSI C/C++; and Microsoft C#, Visual Basic, and Visual Basic .NET.

Recognizing the diversity of measurement applications, National Instruments approaches data acquisition independent of specific PC bus technologies. You can use the same NI-DAQmx API for communicating across PCI, PCI Express, PXI, PXI Express, USB, Ethernet, and Wi-Fi. This means you can use an application developed for a USB data acquisition device with a wireless data acquisition device without making any changes to the software. Because each bus has different portability, throughput, and latency capabilities, NI-DAQmx abstracts the complexity of programming these different architectures from the user. For example, NI signal streaming overcomes the lower throughput and higher latency associated with USB transfers to make bidirectional waveform streaming possible for a cabled USB data acquisition device.

For wireless data acquisition, NI-DAQmx ports technology similar to NI signal streaming to TCP/IP for streaming measurements over Ethernet or Wi-Fi networks. Specifically for NI Wi-Fi DAQ, NI-DAQmx offers three key technologies for streaming wireless measurements:

  1. Device-side intelligence
  2. Message-based communication
  3. NI Wi-Fi DAQ streaming engine

Device-Side Intelligence

An NI Wi-Fi DAQ device is not a typical data acquisition device. Each NI Wi-Fi DAQ device is a combination of an NI WLS-9163 wireless carrier and an NI C Series measurement module. The WLS-9163 provides both IEEE 802.11b/g and Ethernet connectivity back to a host PC. C Series modules offer direct sensor connections and built-in signal conditioning for a variety of measurements, including temperature, strain, high-voltage digital I/O, acceleration, current, and voltage.

Each WLS-9163 carrier features a field-programmable gate array (FPGA), a microprocessor, RAM, and an IEEE 802.11 radio.

NI Wi-Fi DAQ under the hood

Figure 1. Each NI WLS-9163 carrier contains a FIFO, microprocessor, RAM and an IEEE 802.11 radio.

The FPGA interfaces directly with the C Series module and controls the timing and acquisition. Similar to all NI data acquisition devices (including PCI, PXI, and USB), an onboard first-in-first-out (FIFO) memory buffer in the FPGA buffers the data coming from the C Series analog-to-digital converter (ADC).

The FIFO feeds the incoming data to an onboard microprocessor running a real-time operating system and NI-DAQmx firmware. This device-side intelligence is similar to that in NI CompactDAQ hardware. Part of the NI-DAQmx driver is loaded on the WLS-9163 carrier itself to manage the data buffering and wireless connection. The onboard driver recognizes supported C Series modules when they are inserted and loads the appropriate FPGA interface automatically.  A 12 MB RAM buffer attached to the microprocessor provides deep onboard memory for temporary data storage. NI-DAQmx automatically manages the transfer of data from this onboard buffer over the IEEE 802.11 radio to the host-side buffer, where a data acquisition application has access to it.

Message-Based Communication

One of the most obvious trade-offs in selecting wireless as a bus for data acquisition over a plug-in architecture, such as PCI, is latency. There are several reasons for this. NI Wi-Fi DAQ uses TCP/IP to transmit data and configuration information. TCP is a packet-based protocol that ensures every byte sent from the transmitter arrives in order at the receiver. If any byte is missing, the message is resent.  Because every network and every RF environment is different, the number of “retries” can vary greatly, directly impacting the latency of the NI Wi-Fi DAQ device. Unlike with PCI, sending several dozen low-level register commands to configure a device is at best impractical over wireless. NI signal streaming for USB provides message-based communication to avoid lengthy transmissions over a high-latency bus. Similarly, NI Wi-Fi DAQ message-based communication sends short, high-level messages, such as “acquire.commit,” from the host PC that are interpreted by the device-side NI-DAQmx firmware.

Figure 2. Using message-based instructions avoids excessive network traffic from register-level commands

The onboard processor converts these messages into dozens of register-level commands that are necessary to properly set up the FPGA, timing controller, and C Series module. This mechanism reduces the amount of configuration data sent over the wireless network and provides more bandwidth for transmitting actual measurement data.

Another key difference between a plug-in PCI data acquisition or cabled USB data acquisition device and NI Wi-Fi DAQ hardware is the lack of a hard-wired connection. For most applications, you can safely assume that a cabled device will remain cabled for the duration of an acquisition. If a cable becomes unplugged, NI-DAQmx can immediately throw an error. This is not the case with wireless. Because there is no cable, NI-DAQmx sends a periodic heartbeat across the network to determine if the wireless device is still present.

Wireless DAQ timeout cycle

Figure 3. NI Wi-Fi DAQ devices and host computers exchange a periodic heartbeat signal to monitor the integrity of the network link.

The host PC sends a heartbeat request message over the network to the NI Wi-Fi DAQ device. The device must send a heartbeat response within two and a half seconds or the host-side driver assumes it is offline. In essence, this cyclical heartbeat signal defines the maximum latency your acquisition can tolerate. For most networks, two and a half seconds is ample time to ensure a steady wireless link; however, you can customize this timeout value by following the steps outlined in KnowledgeBase 4R49MMD2. The NI Wi-Fi DAQ heartbeat signal delivers added reliability for wireless connections.

NI Wi-Fi DAQ Streaming Engine

Ultimately, the most important factor in maintaining a reliable wireless connection for high-bandwidth waveform data is the NI Wi-Fi DAQ streaming engine. As mentioned earlier, the NI-DAQmx driver is split between the host PC and the NI Wi-Fi DAQ device. These two pieces of software constitute the NI Wi-Fi DAQ streaming engine, which abstracts the complexity associated with wireless data transfers and adds reliability.

Once an acquisition has started, the FPGA onboard the WLS-9163 maintains a sample clock that ensures data points are evenly spaced in time. NI-DAQmx firmware pulls in clocked data from the C Series module through the FIFO and into the 12 MB RAM buffer. On the host side, the NI-DAQmx driver maintains a circular buffer in RAM, the size of which is automatically determined by your sample rate.

NI wireless data acquisition streaming

Figure 4. NI-DAQmx driver software manages the transfer of data across a wireless network.

Data is transferred from the onboard 12 MB RAM buffer to the host-side buffer using TCP/IP. (From the NI-DAQmx host-side buffer, you can call a DAQmx Read function to pull data into your development environment.) Devices with a 16-bit ADC send 2 bytes per sample, and devices with a 24-bit ADC send 4 bytes per sample. Knowing this, you can calculate the maximum bandwidth your acquisition requires. For example, the NI WLS-9234 DAQ device is capable of streaming 24-bit data up to 51.2 kS/s on each of four channels simultaneously:

Therefore, each WLS-9234 may require up to a maximum bandwidth of 6.55 Mbps. Putting that number in perspective, Speedtest.net reports that the average U.S. household Internet downlink bandwidth is 6.17 Mbps. In other words, one NI Wi-Fi DAQ device can stream more data than your home Internet connection is capable of handling.

Occasionally, a wireless link may temporarily become too weak to handle the bandwidth of one or more NI Wi-Fi DAQ devices. In the event of a weak wireless network, the WLS-9163 stores data locally in the onboard 12 MB buffer.

wireless daq buffering

Figure 5. NI Wi-Fi DAQ devices can store data locally when the wireless network becomes unavailable.

When the wireless link becomes active again, NI-DAQmx sends large data sets over the network to the host PC buffer to avoid an overflow condition. From the previous example, 12 MB is enough room to store 14 seconds of data from a WLS-9234 streaming at the full rate on all channels:

The NI Wi-Fi DAQ streaming engine is therefore analogous to downloading any high-bandwidth network data, such as watching a video on YouTube. Before the video begins, several seconds of video is buffered in the player. For slower Internet connections (those with less bandwidth), more video time is buffered to account for the weak connection. All of this is managed automatically to abstract the details from the end user; such is the case with NI-DAQmx.

Summary

NI-DAQmx makes wireless data acquisition a reality. Furthermore, all the details associated with streaming buffered data across TCP/IP are abstracted from the NI-DAQmx API, providing a consistent interface across all data acquisition buses, from Wi-Fi to PXI. With device-side intelligence, message-based communication, and an advanced streaming engine, NI-DAQmx and NI Wi-Fi DAQ provide all the benefits of wireless technology for test and measurement applications without sacrificing the performance or reliability of a wired solution. 

Additional Resources

Learn More about Wireless Data Acquisition

Download the Complete NI Wi-Fi DAQ Resource Kit

 

The mark LabWindows is used under a license from Microsoft Corporation. Windows is a registered trademark of Microsoft Corporation in the United States and other countries.

3 ratings | 3.67 out of 5
Read in | Print | PDF

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).