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 CompactDAQ a reliable platform for wireless data acquisition.
2. 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 Wi-Fi data acquisition, NI-DAQmx offers three key technologies for streaming wireless measurements:
- Device-side intelligence
- Message-based communication
- Wi-Fi NI CompactDAQ streaming engine
3. Device-Side Intelligence
A Wi-Fi NI CompactDAQ system is not a typical data acquisition device. Each Wi-Fi NI CompactDAQ system is a combination of an NI cDAQ-9191 Wi-Fi chassis and an NI C Series measurement module. The chassis 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 NI cDAQ-9191 features a microprocessor, RAM, and an IEEE 802.11 radio.
Figure 1. Each NI cDAQ-9191 chassis contains a FIFO, microprocessor, RAM and an IEEE 802.11 radio.
Controlling the timing of the module and containing four counter-timers is the STC 3 (System Timing Controller). The STC 3 intellectual property controls synchronization and timing for data acquisition operations by providing 32-bit counter-timers, PLL capabilities, and data routing functions.
Similar to all NI data acquisition devices (including PCI, PXI, and USB), an onboard first-in-first-out (FIFO) memory buffer 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 NI cDAQ-9191 chassis itself to manage the data buffering and wireless connection. 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.
4. 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. Wi-Fi NI CompactDAQ 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 Wi-Fi NI CompactDAQ 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, Wi-Fi NI CompactDAQ 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 Wi-Fi NI CompactDAQ 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.
Figure 3. Wi-Fi NI CompactDAQ 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 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 Wi-Fi DAQ heartbeat signal delivers added reliability for wireless connections.
5. Wi-Fi NI CompactDAQ 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.
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.
Figure 5. Wi-Fi NI CompactDAQ 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 NI 9234 streaming at the full rate on all channels:
The 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.
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 Wi-Fi NI CompactDAQ provide all the benefits of wireless technology for test and measurement applications without sacrificing the performance or reliability of a wired solution.
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.