Achieving High Data Transfer Rates with the UHFLI

Introduction

The UHFLI Lock-in amplifier features the smallest time constant on the market, making it an excellent instrument for fast measurements like in imaging applications. The UHFLI can provide demodulated data at a bandwidth of up to 5.2 MHz and sampled at up to 28 MSa/s. That stream of data can be transferred and processed fully digitally – a non-trivial task that requires you to pay attention to a few things. This blog post explains how to measure with the highest possible data rates on the UHFLI. Most of the blog post applies to the base version of the UHFLI, but in the context of high data rates it is interesting to discuss the benefits of the UHF-DIG Digitizer and UHF-10G Optical Ethernet options.

We start by laying out the essential setup preparations to achieve high data transfer rates. This part is useful for everybody interested in transferring Demodulator, AU, PID, or Boxcar data close to the maximum specified rates.

We then show you two useful tricks to push the data rate further if you either can afford a reduced resolution, or a discontinuous stream. Scope streaming allows you to compress a data stream to 12 bit resolution and gain up to a factor of 8 in sampling rate. Data gating allows you to only transfer selected parts of a Demodulator data stream and gain a factor of 2 in the peak data rate.

In the third part we give you some hints on using the API for custom high-speed data processing.

You can find a list of all the key recommendations at the end of this blog post.

Getting your Setup Ready for High Speed

The UHFLI can be interfaced via 1 Gigabit Ethernet (1GbE) and USB 2.0 in the base version, and via 10 Gigabit optical Ethernet (10GbE) with the UHFLI-10G option. Both USB and Ethernet have their advantages, but when speed matters the choice is Ethernet.

The UHFLI streams its measurement data in the form of UDP packets to the host computer. This method works reliably and loss-free even when used at more than 90% of the available bandwidth, and this over the scale of hours. In order to reach this performance, the first thing to make sure is that the host computer has sufficient processing power. If it hasn’t, data packets that arrive can’t be processed fast enough and can get lost due to memory overflow. An up-to-date computer (we recommend an Intel Xeon E5 machine) should therefore be part of a high-speed measurement setup.

A basic performance tweak is the use of Jumbo frames. Jumbo frames allows to send fewer but larger data packets, and reducing the number of packets reduces the processor load. On the UHFLI side, you can enable Jumbo frames from the LabOne Device tab, and on the computer side you can enable them in the network card settings. This is described in detail in the UHFLI Getting Started Guide.

Be aware that Jumbo frames can be in conflict with local network policies. The safest way to avoid such problems is to establish a point-to-point connection with static IP addresses between computer and UHFLI. Check the Getting Started guide to learn how to do that. An optimal solution is to dedicate one network card to the instrument communication and to use a second one to connect to your local network. Like this, you can still profit from the simplicity of domain name system (DNS) configuration on the local network.

If your local network supports Jumbo frames, you can usually avoid the point-to-point connection. However, it is important to prevent the data stream between computer and UHFLI from passing by other network nodes. This is achieved by connecting the two to the same Ethernet switch.

With the UHFLI-10G option, generally the same conditions apply as for 1 GbE. Note that the UHF-10G option includes an Intel PCIe 10 Gigabit card and fiber cable. With the base version of the UHFLI, you can continuously transmit up to 1.6 MSa/s of demodulated data to your computer. The UHF-10G option allows you to push that to 3.2 MSa/s.

Two Tricks for Faster Measurement

Gating of Demodulator Data

There are possibilities to use the available data rate more efficiently. The first possibility is gating of Demodulator data, which was introduced with LabOne version 15.01. It applies to cases where you only need small portions of the data stream – for example in a pump-probe experiment. To make use of this method you need to provide an external gating signal (typically a TTL-level signal) on Trigger Input 3 or 4 that marks the interesting data.

Figure 1: Setup used for gated Demodulator data streaming.

Figure 1: Setup used for gated Demodulator data streaming.

To demonstrate the technique, we use the measurement setup shown in Figure 1. We connect the Signal Output 1 and Signal Input 1 of the UHFLI, and then we configure the UHFLI in a heterodyne manner so that it measures oscillating X and Y values on Demodulator 1. Using an arbitrary waveform generator (AWG), we generate a pulse wave signal that is characterized by a period of about 80 μs and that spends about 8 μs in the “high” state – i.e., 10 percent of the time. We connect this signal to Trigger Input 3. In LabOne, we configure the Demodulator 1 to output data only when Trigger input 3 is “high” (cf. Figure 2, top). The average data rate passing over Ethernet is then only one tenth of the peak data rate. Note that with LabOne, you can monitor the current data transfer rate in the Statistics section of the Device tab. Figure 2 shows how the gated X and Y Demodulator data (blue and green curves) look in the Plotter tab. Note that despite the gaps in the data stream, the curves are continuous. This is simply because the Plotter uses a linear interpolation in the places where there is no data. It is possible to push the peak data rate to 3.5 MSa/s without losses. Check the Sample Loss flag at the bottom right of Figure 2 – it would turn red/yellow in case of data loss.

Gated demodulator data stream viewed in the LabOne user interface

Figure 2: Gated Demodulator data stream viewed in the LabOne user interface

Scope Streaming

A second optimization becomes accessible with the UHF-DIG option. The Demodulator data stream contains a certain overhead – every Demodulator sample encodes, apart from the 64-bit X and Y components, a 64-bit timestamp, the frequency, and other data. Using the LabOne Scope it is possible to greatly reduce this data in cases where you don’t need the full dynamic range of the 64 bit. Namely, you can use the Scope to convert the Demodulator sample stream into a pure 12-bit data stream with negligible overhead. This allows you to go to considerably higher Demodulator sampling rates, up to 14 MSa/s on 1GbE and up to 28 MSa/s on 10GbE.

Figure 3: Block diagram showing the signal path of the demodulator data when using UHF-DIG Scope streaming

Figure 3: Block diagram showing the signal path of the Demodulator data when using UHF-DIG Scope streaming

To set this up, we make use of the possibility to select Demodulator X and Y values as the Scope input. This is a feature of the UHF-DIG option and it applies to other signals like Demodulator R, Θ, Arithmetic Unit, or Boxcar. As shown in Figure 3, the Scope stream controller will adjust the resolution of its input signal to 12 bit and also resample the data according to the user-defined rate. Figure 4 shows how to select Demodulator X and Y data as the inputs of the scope channels 1 and 2 respectively. Once you have selected the signal, adjust the Scope range just like you would do for an analog input signal. For the example shown in Figure 4, we chose a range of -100 mV to +100 mV to use the 12 bit resolution efficiently.

Range setting in the LabOne Scope to optimize streaming data

Figure 4: Range setting in the LabOne Scope to optimize streaming data

It should be emphasized that the Scope streaming rate is a separate parameter from the Scope shot sample rate (the one you set in the Scope tab) and the Demodulator sample rate (the one you set in the Lock-in tab). The three rates are marked with dashed rectangles in the diagram in Figure 3. The Scope streaming rate can be set from the Plotter tab, as shown in Figure 5. Here we set it to 7 MSa/s. Up to 14 MSa/s are possible when using Scope streaming from the API, and up to 28 MSa/s with the UHF-10G option.

Enabling Scope streaming from the Plotter tab

Figure 5: Enabling Scope streaming from the Plotter tab

Once streaming is enabled, you can view the live data in the Plotter tab by checking the proper node in the Tree subtab (Device XXXX/Scopes/Scope 1/Streaming/Sample). This is shown in Figure 5.

Enabling the display of streamed scope data in the LabOne Plotter.

Figure 6: Enabling the display of streamed scope data in the LabOne Plotter.

API Data Processing

With the high-bandwidth data stream arriving at your computer, often you’d like to do some custom processing rather than saving the raw data to the disk. The LabOne APIs are excellent for this task. The programming examples that come with the LabOne installation are good starting points to implement your own API solution. To customize the examples, an efficient tool is the command display in the status bar of the LabOne UI. It allows you to quickly find the API command corresponding to a graphical UI setting. For general programming guidelines and reference purposes, check out the Programming Manual. Pay attention to performance brakes like unnecessary type conversions or memory allocations at the first stage of processing. When using the poll command from Matlab, LabView, or Python, use a short poll length parameter (e.g. 5 ms) and poll in regular intervals (e.g. 100 ms) to minimize the time the processor waits for the data. Operations like averaging, offset subtraction, and others of similar complexity are then easily possible in parallel with the high-speed acquisition.

Summary

Here’s what we suggest to reach maximum data transfer performance, roughly in order of importance:

  1. Use a powerful computer

    The fastest connection can’t help if the processor behind is overwhelmed with data. We recommend a Xeon E5 machine with at least 8 GB of memory.

  2. Use the right network card

    We have found that the following Intel models work well: I210-T1, I350-T2, PRO/1000 PT. Older network cards can reveal flaws under load, e.g. the widespread Intel 82579LM family.

  3. Enable Jumbo frames

    Increasing the UDP frame size to 4088 bytes allows for a big reduction of the processor load.

  4. Use gated demodulator or scope streaming

    Reducing the amount of data before it is sent both reduces network and processor load.

  5. Use the API instead of the Graphical UI

    Running the graphical UI costs some processor time – the highest processing performance is a benefit reserved to the API user.

  6. Use point-to-point connection and static IP address

    Using a single Ethernet cable to connect UHFLI and host computer removes all unnecessary intermediates.