Posts

Showing posts from 2012

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…

Moving to Lantz

Image
Lantz is a Python automation and instrumentation toolkit that allows you to control instruments in a clean and efficient manner writing pure Python code. Since I released Lantz a few weeks ago, I have received a lot of positive e-mails about the project. Most of them can be summarized as: It looks very nice! I love Python and I have been looking for a Pythonic way to do instrumentation!
It is encouraging to receive such positive comments and also confirms that Lantz is in the right path: Not a Domain-specific language, not a do-it-my-way framework, but a complete, coherent and concise set of classes and functions for instrumentation in Python. Lantz provides base classes and functions decorators to help you write your drivers as shown in the figure (thanks Pablo Jais!). You can find more details in the documentation's overview.
Inertia is what stopping many to start using Lantz. For most of us, instrumentation is the means to an end. We need to measure, do experiments, get results…

Announcing Lantz: Instrumentation in Python

Image
Today I am releasing Lantz, a Python automation and instrumentation toolkit that allows you to control instruments in a clean and efficient manner writing pure Python code.

Instrumentation and experiment automation became a cornerstone of modern science. Most of the devices that we use to quantify and perturb natural processes can or should be computer controlled. Moreover, the ability to control and synchronize multiple devices, enables complex experiments to be accomplished in a reproducible manner.

This toolkit emerges from my frustration with current solution. If you have worked in a research lab, you know that most that is out there is done using Domain Specific Languages (DSL) like LabVIEW and MatLab Instrumentation Toolbox. They are great for their original purpose but as soon as you want to code a real application their idiosyncrasy gets in the way. They lack certain features and good design that we enjoy in some general purpose languages. So the choices are: you move to La…