The structure of a Lantz Driver

Lantz is a Python automation and instrumentation toolkit that allows you to control scientific instruments in a clean and efficient manner writing pure Python code.

All Lantz drivers classes are derived from Driver, which provides the infrastructure and boiler plate code to perform common operations. Logging, timing, async calls and other features are enabled by sub-classing from Driver.

But usually you do not subclass from Driver directly, but rather from a specialized class depending on the way you communicate with your instrument. For example, if the instrument is controlled over RS-232 (Serial), you sub-class from SerialDriver. If it is controlled over TCP, you sub-class from TCPDriver. There is also a class for GPIB and there be soon will for USB.

All these classes belong to the same family as they communicate with instruments by exchanging  textual messages. They share a common interface and therefore it is very easy to build drivers that support different communication channels:
Loading ....

Of a different kind are instruments that are controlled by calling function in a library (e.g. a ,dll or .so). Typical examples for these are cameras and acquisition boards (under the hood, they also exchange messages but the library handles that). In this case, you driver will sub-class LibraryDriver which provides a simple and cross platform way to perform library calls.

Other important pieces of Lantz are Feat, DictFeat and Action. We will discuss those in future posts.

What's new

  • New multi device example (Thanks to Pablo Jais)
  • Better support for units in Qt Widgets (Thanks to Martín Masip)
  • Preliminary support for NI-DAQmx 
  • Support for NI-VISA in Windows (Thanks to Martín Caldarola)
  • installation script to simplify installation in Windows

There are still a lot of things to do, but Lantz is already very useful. Join us! 

What's next

  • Complete NI-DAQmx support
  • Better support for async execution in GUI using Qt Threads
  • Qt Signal/Slots like syntax for events
  • More drivers!
  • [put your ideas here]

For more details take a look at the tutorials.

... and tell us what are you doing and how we might help.

Project documentation: main server and GitHub mirror

Public source code repository: GitHub

Popular posts from this blog

Communicating with instruments using PyVISA but without NI-VISA

Running Python code in a LaTeX document

Lantz 0.3 is out: better PyVISA support, leaner drivers, great GUI building blocks