A deep dive into data acquisition with the DAQ tool

Introduction

Looking at the heart of experimental science you will find data acquisition. Why? Because even the most perfectly conceived experiment is worth nothing if nobody acquires, analyzes and stores data for further analysis and reproduction of results. Despite its obvious importance, data acquisition does not always receive the necessary attention. In a series of three consecutive blog posts we want to concentrate on this topic and deepen the knowledge base about the capabilities of the LabOne Data Acquisition (DAQ) module.

The integration of the DAQ module – previously named Software trigger module – into the LabOne Software in version 17.12, introduced a very powerful tool for triggered and transient data acquisition in both the time and frequency domains in graph or image mode. Our customers routinely use the DAQ for instance in SPM, ring down measurements on resonators or in microfluids experiments.

Although many different applications already rely on the DAQ, at Zurich Instruments we found that many users don’t take full advantage of its capabilities. Therefore, this blog post gives a general introduction to the functional features of the DAQ module and walks the reader through some basic examples. For this to be useful to every customer, I used a MFLI with no additional options for these examples. However, everybody can replicate them on any Zurich Instruments Lock-in Amplifier.

 

Basics of the DAQ and data saving

Settings

Let’s start with an easy example. You will learn how to control the trigger level, the data rate and the duration of a measurement with the DAQ, and how to save the data. For this example, connect a BNC cable between the signal output and signal input of the lock-in amplifier (see Figure 1) and use the settings given in Table 1.

Figure 1: BNC connection for baisc DAQ measurement

Tab Section # Label Setting/Value/State
Lock-in Oscillator 1 Frequency 100 kHz
Lock-in Output 1 Amplitude 200 mV
Lock-in Output 1 Offset 0 V
Lock-in Output 1 On On
DAQ Run/Stop On

Table 1

Start the output and feel free to check your sinusoidal wave with the scope. Now open the DAQ module and press Run/Stop. Don’t worry if you don’t see any measurement yet, because the DAQ module waits for a trigger which you haven’t yet set up. The DAQ works like the oscilloscope from the Scope tab. Differently from the Scope, however, it always needs a trigger and is not used to acquire data at the signal input but after demodulation instead. You can control the DAQ with the panels on the right-hand side of the plot (Control, Settings, Grid, History and Math).

Let’s first focus on the settings. Here you define which trigger to use, the trigger types and level, hold off time and so on – as you would expect from any oscilloscope or digitizer card. For the first measurement, go to the section Output in the Lock-in tab and turn the output off and back on. You should now see your first trace with the DAQ (see Figure 2). What you measured is the amplitude of the demodulated input signal after you turned the output back on. This signal is proportional to the filter response in time. We will look at the relationship with the filter bandwidth later. What you should do now is play around with the different trigger settings, i.e. Level and Delay as well as the Output Amplitude – and by turning the Output off/on you should trigger measurements.

Figure 2: Triggering measurements by turning Output On/Off

Duration, Sampling, Averaging

Next we take a look at the connection between duration, sampling rates and averaging and their effect on the data acquisition. You can control these parameters in the section called Grid of the DAQ tab and in the section Data Transfer in the Lock-in tab. The settings are shown in Table 2.

Tab Section # Label Setting/Value/State
DAQ Grid Mode Exact (on-grid)
DAQ Grid Operation Average
DAQ Grid Columns 512
DAQ Grid Duration (s) 305.835 m (automatically derived)
DAQ Grid Rows 1
DAQ Grid Repetitions 1
Lock-in PC Data Transfer 1 En On
Lock-in PC Data Transfer 1 Rate 1.674 kSa/s
Lock-in PC Data Transfer 1 Trigger Continuous

Table 2

The DAQ uses three modes for acquiring data. In exact mode the duration is automatically derived and depends on the number of columns and data transfer rate: \(\textrm{duration}=\frac{\textrm{columns}}{\textrm{data transfer rate}}\). In your current settings this should correspond to a duration of approx. 300 ms. Note that the duration is only updated after you run the DAQ again. In linear or nearest mode you can adjust the duration independently of the columns and data transfer rate, and resampling is done using either linear or nearest-data-point interpolation. Operation and Repetitions defines whether you want to use averaging or standard deviation and how many repetitions are used for averaging. I would suggest that you play around with the different grid settings and the data transfer rate and watch the effect on your measurements. There is one important aspect to note: when using high data transfer rates, you produce a lot of data that needs to be transmitted via your connection from the instrument and later stored on your device.

Save Data

As a last step in the tutorial you will do an actual measurement and save it. Make sure you go back to the settings of Table 1 and Table 2. Repeatedly trigger a measurement by turning the output off/on and for each repetition reduce the filter bandwidth from 100 Hz in steps by a factor ½ to approx. 3.125 Hz (for settings see Table 3).

Tab Section # Label Setting/Value/State
Lock-in Output 1 On Off/On
Lock-in Low-Pass Filter 1 Order 3 (18 dB/Oct)
Lock-in Low-Pass Filter 1 BW 3 dB 100 Hz reduce by factor ½

Table 3

Figure 3: Measurements of filter response times at different bandwidths

What you measured is the filter response time at different bandwidths. As expected, at a smaller bandwidth the filter has a larger settling time, which corresponds to a slower response. For a detailed description how the filter settings influence your measurement, please watch the video low- pass filter video. If you want to keep these data for later use, save them directly from the display in the DAQ tab, either as an image or as data with the three rightmost buttons below the display itself; alternatively, save them by using the section History. When using the display you can only save the last trace, whereas in the History section you can save all or a selection of traces to one single file. The format you choose and your way of saving – via the History or directly from the display – will change what data you save and how your data is sorted. You can find a detailed description in your LabOne user manual. Save the data in your favorite format (*.mat, *.csv, *.sxm, *.h5) and use your favorite plotting software to generate a nice graph. This ends our first example.

 

Learn how to use an external trigger

Create a trigger signal with the sweeper

The first example wasn’t very realistic because it is very unlikely for a user to trigger the DAQ manually. In the second example we look at a more common situation in which you use an external trigger to tell the DAQ when to acquire data. Since not all users will have the possibility to create such a trigger, you can also generate a DC offset signal with the device itself. You can do this by connecting a second BNC cable from Aux Output 1 to Aux Input 1 (see Figure 4) and by sweeping the Offset of the auxiliary output to generate a signal the DAQ can trigger on. (see Figure 4 and Table 4).

Figure 4: BNC connections setup to generate an external trigger with the sweeper

If you have performed the first example you can keep your settings, otherwise make sure you have the settings from Table 1 and Table 2. Additionally, change the settings in the Aux tab according to Table 4. Then open the Sweeper tab and start a sweep with the settings from Table 4. This will generate your trigger signal because the auxiliary output will sweep between 0 and 1 V. It may be best to put the Sweeper tab in a position where you can see the sweeper and the DAQ at the same time (see Figure 5).

Tab Section # Label Setting/Value/State
Aux Aux Output 1 Signal Manual
Sweeper Control Sweep Param Auxiliary Outputs/Aux Out 1 Offset
Sweeper Control Start (V) 0
Sweeper Control Stop (V) 1
Sweeper Control Length (pts) 20
Sweeper Control Sweep Mode Sequential
Sweeper Run/Stop On

Table 4

Figure 5: The Sweeper and DAQ tab can be in a position where you can see both at the same time

The Node Tree for trigger and signal selection

Now we want to define our trigger. When you select the trigger in the Settings section of the DAQ tab a Node Tree appears, which lists the selectable trigger signals ordered into main groups and subgroups. A similar Node Tree opens when you open the Control section and select a signal from the little tree-like button next to the label Add Signal. In both Node Trees some signals like the auxiliary inputs appear as subgroups of each demodulator but also separately as another main group (see Figure 6).

Figure 6: The Node Tree for trigger selection

To understand the difference of each main group in these Node Trees, we need a deeper understanding of the implementation of the DAQ in the LabOne software: the DAQ runs on the data server, which runs on your computer and not on the FPGA of the device – note that in the MFLI it can also directly run on the embedded web server of the device. Each signal you can select belongs to a main group, and it will be sampled and transferred to your computer at the rate of the main group. In the case of a main group that has the name of a demodulator, it will be sampled at the rate you have specified for that demodulator in the Lock-in tab. If you want to simultaneously measure signals from different main groups (i.e., different demodulators) you have to be careful, because sample timestamps are not necessarily aligned at different sampling rates (see Figure 7). However, in the Lock-in tab there is a nice feature– a little blue button just above the sampling rates – that sets all sampling rates of all demodulators to be equal.

Figure 7: Sampling of three different signal sources. Sample timestamps are not necessarily aligned at different sampling rates

Some signals, for instance the auxiliary inputs, appear in more than one main group or even as a separate main group in the Node Tree (see Figure 6). This is needed because in some cases it might be necessary to trigger and sample data directly at the auxiliary inputs and not with the sample rate of one of the demodulators. This might be the case when you need a good signal-to-noise ratio to trigger on very small auxiliary input signals. Since the auxiliary inputs are sampled with a digital-to-analog converter different from the one used for the signal inputs, you can select the rate at which their data is transferred to the computer separately. You can adjust this rate in the tab called ZI Labs. Adjust this rate only if necessary because in most cases it will be sufficient to sample the auxiliary inputs at the same rate as the one from a given demodulator.

Trigger the DAQ

Now set up the DAQ with the settings from Table 5 to use the auxiliary input as the trigger source and to measure the amplitude R of demodulator 1 and the auxiliary input itself.

Tab Section # Label Setting/Value/State
DAQ Settings Trigger Signal Demodulators/Demod 1 Sample/Aux In 1
DAQ Settings Trigger Type Edge
DAQ Settings Trigger Edge Positive
DAQ Settings Level (V) 100 m
DAQ Settings Hold Off Time (s) 200 m
DAQ Control Time Domain/Signal Type Demodulators/Demodulator 1/Sample/R
DAQ Control Time Domain/Signal Type Demodulators/Demodulator 1/Sample/Aux In 1
DAQ Single Press once

Table 5

If you let the DAQ measure only one trace by pressing the Single button you should get a result similar to the one displayed in Figure 5. You can see how the DAQ triggers at a level of 100 mV of the auxiliary input 1 and measures the amplitude R of demodulator 1. In our example we generate an external trigger by sweeping the auxiliary output, but in most use cases your external trigger will come from another source. The DAQ supports a variety of different analog and digital trigger signals, which can be used for complex triggering schemes such as end of line triggers. Further details about this scenario will be discussed in the second post of this blog series about the DAQ.

Retriggering the DAQ

In the final part of this example we look at the powerful retriggering abilities of the DAQ. Go the Grid section of the DAQ and change the number of Columns to 16384, which corresponds to a duration of 9.787 sec. Measure one trace of the DAQ by pressing the Single button.  You should get a result similar to the one in Figure 8.

Figure 8: Long trace shows five possible trigger events at 100 mV

From the level of the auxiliary input (blue curve) you can estimate that within this long trace the DAQ could trigger five times, approximately every 2 sec. One powerful feature of the DAQ is that it can have zero hold off time until another measurement can be triggered. If you set this value to be equal to the duration, you avoid retriggering. If you set it to 0 or any value lower than your actual trigger rate, the DAQ will continuously retrigger although the trace of the last trigger event won’t have reached its full duration. Try this now by setting the Hold Off Time to 0 in the Settings section and starting the DAQ in continuous mode by pressing Run/Stop. You should see a new trace of your DAQ approximately every 2 sec. Provide your trigger signal at a higher frequency by selecting only 2 points instead of 20 in your sweep and see how fast your traces are acquired even if your duration is much longer (see Figure 9).

Figure 9: Retracing can be done at very high rates

The way we set things up for the retriggering is not how a user would normally do it, because with a periodic trigger it does not make a difference whether we take one very long trace or periodic retraces overlapping in time. This is different for non-periodic signals like the one displayed in Figure 10. That signal has six successive pulses and each pair of odd and even pulse numbers corresponds to the same sample. One example of such a signal could be a measurement which takes place at two spatially separate contact points and the time Δt1 corresponds to the time the sample takes to pass from the first contact point to the second. In this example, the times Δt2 and Δt3 – which correspond to the arrival times between recurring samples – are not known and also not of much interest for the measurement. Instead the user is interested in Δt1, σ1 and σ2. In the DAQ the signal should be used as trigger source, the Hold Off Time set to 0 and the trigger level to a value such that the trigger will be armed for each of the six peaks. For each trigger event the DAQ will only measure with a certain duration the corresponding peak which can then be further analyzed (see Figure 10). Δt1, σ1 and σ2 for instance could be calculated from the timestamps.

Figure 10: Example of a signal used in retriggering. The signal is seen on top while the retriggered traces can be seen in the bottom. 

Now you should play around again with the settings and see the influence of the frequency at which you provide your trigger signals and the hold off time on your traces. Try also saving the traces with Auto Save in the History section, which will make your measurement much easier. But be careful with autosave if you have fast retriggering of your DAQ and a long duration, as you will produce enormous amounts of data! This ends our second example.

 

Learn how to use 2D mode

Imaging with the DAQ

Our last example focuses on the imaging capabilities of the DAQ. This will be kept much shorter than the other two examples because the next blog post will focus on this aspect of the DAQ. If you have performed the second example you can keep those settings as a starting point, otherwise make sure you have the settings from Table 1, Table 2, Table 4 and Table 5. To start producing images use the settings from Table 6.

Tab Section # Label Setting/Value/State
Sweeper Control Length (pts) 20
DAQ Grid Rows 5
DAQ Grid Waterfall On
DAQ Grid Overwrite On
DAQ Control Time Domain/Plot Type 2D + Row
DAQ Run/Stop On
DAQ Control Time Domain/Vertical Axis Groups/Demod 1 Sample Aux In 1 Select

Table 6
The DAQ should now show two windows above each other, with the upper window showing a 2D representation of the last 5 traces the DAQ measured and the lower window showing the last trace that was taken (See Figure 11). But the DAQ can not only measure in the time domain. It is possible to take an FFT simultaneously. Use the settings from Table 7 and you should obtain a result like the one in Figure 12.

Tab Section # Label Setting/Value/State
DAQ Control Frequency Domain/Plot Type 2D + Row
DAQ Control Frequency Domain/Signal Type Demodulators/Demodulator 1/Sample/R
DAQ Control Frequency Domain/Signal Type Demodulators/Demodulator 1/Sample/Aux In 1
DAQ Control Frequency Domain/Vertical Axis Groups/Demod 1 Sample Aux In 1 Select

Table 7

Figure 11: DAQ used for 2D imaging

One nice feature of the DAQ is that all signals you measure are always there. This means that if you select a different signal in the Vertical Axis Group to be displayed, you don’t have to wait for the DAQ to take all traces again before you can see an image.

Figure 12: Time and frequency domain can be observed in 2D

A complicated signal measured in the time and frequency domain

As the final step of this blog post, we will generate a more complicated signal using three oscillators to generate a beat signal and measure the demodulated signal with the DAQ. Unfortunately, this is only possible with more than one oscillator in your Zurich Instruments Lock-in Amplifier. For the MFLI you would need the Multi-Demodulator and Oscillator option. Nevertheless, users without this option should still get the general idea. Start by using the settings from Table 8.

Tab Section # Label Setting/Value/State
Sweeper Run/Stop Off
Lock-in Oscillator 1 Frequency 100 kHz
Lock-in Output 1 Amplitude 200 mV
Lock-in Output 1 Offset 0 V
Lock-in Output Amplitudes 1 En On
Lock-in Oscillator 2 Frequency 100.01 kHz
Lock-in Output 2 Amplitude 100 mV
Lock-in Output 2 Offset 0 V
Lock-in Output Amplitudes 2 En On
Lock-in Oscillator 3 Frequency 100.1 kHz
Lock-in Output 3 Amplitude 100 mV
Lock-in Output 3 Offset 0 V
Lock-in Output Amplitudes 3 En On
Lock-in Signal Outputs 1 On On
DAQ Grid Columns 512
DAQ Grid Rows 5
DAQ Grid Waterfall On
DAQ Grid Overwrite On
DAQ Settings Trigger Signal Demodulators/Demod 1 Sample/R
DAQ Settings Level (V) 100 m
DAQ Settings Hold Off Time (s) 99 m
DAQ Control Time Domain/Plot Type 2D + Row
DAQ Control Time Domain/Signal Type Demodulators/Demodulator 1/Sample/R
DAQ Control Time Domain/Plot Type 2D + Row
DAQ Control Time Domain/Signal Type Demodulators/Demodulator 1/Sample/R
DAQ Run/Stop On

Table 8
The result is shown in Figure 13. The DAQ triggers every 100 ms at a level of 100 mV. In this example, we used three oscillators with frequencies of 100 kHz, 100.01 kHz and 100.1 kHz. Since the signal is demodulated with oscillator 1 as a reference frequency, the demodulated amplitude R has two frequency components at 10 Hz and 100 Hz which you can nicely observe in both time and frequency regimes.

Figure 13: Complicated signal depending on three frequencies (100 kHz, 100.01 kHz and 100.1 kHz). The DAQ measures the demodulated amplitude R with a reference frequency of 100 kHz. The other two frequencies at 100.01 kHz and 100.1 kHz can be clerly seen in the 2D display in the time and frequency domain

Figure 13 concludes our introduction and tour of the basic features of the DAQ. It should have given you a good grasp of how sophisticated you can make your measurements and of how easily you can acquire, analyze and store data with the DAQ from Zurich Instruments Lock-in Amplifiers to boost you lab performance.

1 comment to A deep dive into data acquisition with the DAQ tool