A Signal Recovery 7265 lock-in amplifier was recently added to the electronics bench. LIAs are AC voltmeters which measure the response of a carrier-stimulated device, often overwhelmed by noise, by down-converting to DC and low-pass filtering the bejesus out of it. The 7265 integrates high-gain bipolar and FET input stages, allowing measurement of current or differential voltage sources with sensitivity down to 2 nA/2 nV at frequencies from .001 Hz to 200 kHz. The 2 nV/√Hz @ 1 khZ input stage can be used independently, increasing the utility of the instrument.
Like many instruments released in the 1990’s, the device may be remote-controlled via GPIB or RS232. The vendor’s Acquire software is capable, but incompatible with the Agilent 82357B USB-GPIB interface used to communicate with legacy gear in the lab.
So, like any self-respecting serial-obsessor, I rolled my own applet to control this instrument. The application was developed using GNU C++ atop my cross-platform libraries, which include a convenient wrapper for the VISA instrument control libraries. While some complain about bloat of the VISA libraries supplied by Keysight and NI, its use is justified in my opinion.
The VISA control library abstracts the physical connection to instruments, providing a consistent software interface to all attached instruments, from any vendor, connected via GPIB, USB, ethernet, PCI/PCIe or RS232. It also contains a handy trace log facility to allow inspection of commands sent to/from instruments during code development.
Lab instrumentation in my lab is attached to a PC, which is configured with numerous specialized applications and instrument control programs. Consequently, development tool-chains are not installed or actively maintained on that platform. The development PC is located in more comfortable environs and it contains modern distributions of CAD and software development tools.
Notably, modern VISA distributions include server software which runs on the lab PC and provide transparent access to to all lab instruments from the development PC in my office, irrespective of their particular host interface. This is extremely convenient during the development cycle.
The applet was developed using the excellent QtCreator toolset. Real-time graphics were implemented using the superb QCustomPlot graphics library. Experimental data is stored to disk in real-time in GetData format, principally because that trivialized post-visualization of captured datasets using KST Plot.
Many drivers previously developed for instruments such as DVMs, signal generators, etc to perform automated tests did not require explicit multi-threading. For example, the Agilent 34970 data acquisition unit is capable of executing relatively complex scans controlling multiple multiplexed devices for time periods spanning hours. But the 34970 supports use of service requests (SRQ) to asynchronously notify the host application throughout sequence execution. The driver’s SRQ routine is akin to a microprocessor interrupt handler and is sufficient to provide asynchronous data processing and host call-backs to maintain application responsiveness.
By contrast, the 7265 driver required careful use of helper threads to maintain responsive behavior. While the 7265 is a relatively sophisticated instrument with an 68000 system management CPU and helper DSPs capable of performing phase locking of of the carrier, down-conversion and low-pass filtering/measurements autonomously, host real-time data display and post-processing /transfer of captured “curve-buffer” data necessitated multi-threading. Their hidden presence within the driver eliminates UI lag and mitigates latency in the post-processing of capture buffer data.
The Windows version of the LockIn applet can be freely downloaded here. A Linux version can be provided, if required.