Capturing transients with Zurich Instruments Toolkit: Programing your instruments was never that easy

In many applications, Zurich Instruments lock-in amplifiers and impedance analyzers are integrated into a larger measurement system. Having an application programable interface (API) to obtain necessary information from the instruments is of great importance in such cases. Thanks to the 5 included LabOne APIs, Python, C, MATLAB®, LabVIEW™, and .NET, one can conveniently achieve this goal with minimal effort. If you are not yet familiar with them, you are welcome to have a look at our recent tutorial video, which shows how easy it is to get your data by an API in less than 5 minutes.

And beyond that, we have also introduced a new high-level Python programming interface for Zurich Instruments devices: the Zurich Instruments Toolkit. With this new toolkit, not only does the node tree structure become more readable (hierarchical), but the workflow of high-level modules such as sweeper and data acquisition (DAQ) is also greatly simplified. This blog post will present a practical example (code can be downloaded here), i.e. capturing transient capacitance, which is commonly needed in deep-level transient spectroscopy (DLTS). This example requires MFIA impedance analyzer or MFLI lock-in amplifier with MF-IA option. But the toolkit can be used also in other products from Zurich Instruments (the HF2LI is an exception).

To highlight the advantages of both methods, LabOne Python API (ziPython) and zhinst-toolkit:

Advantages of ziPython:

  • Clear command log, ready to be pasted into your own scripts
  • The ability to load nested dictionary to cover all settings parameters
  • Comprehensive and flexible settings to optimize signal acquisition

Advantages of zhinst-toolkit:

  • Hierarchial node structure in Python style
  • Focus on changing key parameters while leaving others at default settings
  • Simplified workflow for high-level modules


Setup and initialization
If you would like to repeat the measurement taken in this blog post, you would only need a small diode as the device under test (DUT), which can be a solar cell or a light-emitting diode (LED). To generate a square voltage pulse, the threshold unit can be used. Naturally, the setup steps can be done in the LabOne graphical user interface (GUI) without API programming. With the command log, you can track which lines correspond to the changes in the GUI, and simply paste them into your own Python scripts. We have also provided official examples in the LabOne Python API library, which shows how to synchronize all setting parameters in one single nested dictionary.

On the other hand, if you are used to the dot (.) notation in Python, then the zhinst-toolkit may be more convenient. Particularly when you are only interested in adjusting a few key parameters, accessing the node tree in this way is more intuitive.

Fig. 1 MFIA with MFITF fixture. The mounted device shown is a solar cell but can also be other diodes (e.g. small LEDs) for the measurements described in this blog post. A short BNC cable connects Aux output 1 to Aux input 1, for generating and receiving square pulses, respectively.


DAQ using ziPython

To find out how zhinst-toolkit helps to simplify high-level modules, we can have a look at the comparison below. Figure 2 shows the code in ziPython. In addition to the code pasted from the GUI, it is necessary to manually add lines, for example, with a progress indicator to run and finish the DAQ module. Setting a sufficiently long timeout can be important when studying a slow process, for instance.

It should also be mentioned that the time in the measured data is saved in the format of ‘timestamp’. To calculate the real time, you will need to divide it to the clockbase which varies on different instrument platforms.

Fig. 2 Example of DAQ module in ziPython. The long syntax in the plt.plot line is used to calculate the real time from timestamp.


DAQ using zhinst-toolkit

Now we turn to zhinst-toolkit, where the progress indicator and the timestamp are taken care of by default. This means that all you need to do is just plot the value (more precisely, its 0th row, as the value is a multi-dimensional array) against time. Therefore, zhinst-toolkit greatly helps to simplify your workflow in these high-level LabOne modules.

Fig. 3 Example of DAQ module in zhinst-toolkit.

To conclude, we now compare the result from zhinst-toolkit to the one from the GUI. We can see they match almost perfectly. The only noticeable difference: in the GUI, the default setting has a trigger delay of -1 ms, so there are also data (baseline) available before the first trigger (in negative time). Whereas in zhinst-toolkit, by recalculation, we choose to start from 0.

Fig. 4 Comparison of the results from LabOne GUI (upper) and zhinst-toolkit (lower). 

If you are interested to know more what zhinst-toolkit can do, please also have a look at its documentation. Please do not hesitate to contact us if you have any questions.

*Note that zhinst-toolkit is not available on the HF2 platform.