-
Notifications
You must be signed in to change notification settings - Fork 4
Home
The main goal of this project is to create a unified object oriented way of controlling instruments from MATLAB, then pairing this with a MyDaq
program that allows for fitting and cursory processing of the data before saving.
The main entities of the project are
- Instrument classes (most of which are derived from
MyInstrument
) that communicate with physical devices, acquire data and send it toMyCollector
usingNewData
event. -
MyCollector
, an object that always runs in the background and keeps track of all the running instrument objects. When an instrument object records a new data trace,MyCollector
provides metadata for the trace, containing the information about the state of the running instruments. -
MyDaq
that collects, displays and saves data traces together with the information about conditions (instrument parameters) at which they are acquired.
Furthermore, there is a number of tools that extend the basic functionality, including
-
MyFit
implements interactive fitting procedures, which are employed inMyDaq
or can be used independently. -
MyLogger
can record, save and display measurements taken periodically, e.g. pressure or temperature readings.
- Add the base project folder with all subfolders on MATLAB path.
- Run
Setup.mlapp
which will create a local base directory for the software that contains a file with local settings and script-like "run files" for custom programs. - Run
MyDaqMenu
and list local instruments (their addresses, ways of communication etc.) usingMyInstrumentManager
. - Run
MyDaq
, select acquisition instrument and read a trace using the instrument GUI. Once the trace is acquired by the instrument, it should show up inMyDaq
.
The list below provides correspondence between instrument classes and physical devices which they were tested with. This list might be not exhaustive, see the content of Instrument classes
folder. The classes below may also be compatible with different devices from the same vendors and of similar model.
-
MyTekDpo
- scopes Tektronix DPO4034, DPO3034 -
MyAgilentDso
- scope Agilent DSO7034A -
MyTekTbs
- scope Tektronix TBS2074 -
MyTekTds
- scope 2-channel Tektronix TDS -
MyTekRsa
- real-time spectrum analyzers Tektronix RSA5106, RSA5103 -
MyAgilentNa
- network analyzer Agilent E5061B -
MyPreifferTpg
- pressure gauge controllers Pfeiffer TPG262, TPG362 -
MyNewpTlb6300
- tunable diode laser controller NewFocus TLB6300 -
MyNewpTlb6700
- tunable diode laser controller NewFocus TLB6700 -
MyHfWs
- wavelengthmeter HighFinesse WS6-200 -
MyThorlabsPm
- powermeter Thorlabs PM100D -
MyLakeshore336
- temperature controller Lakeshore Model 336 -
MyZiLockIn
- lock-in amplifiers from Zurich Instruments, UHFLI and MFLI -
MyColdEdgeCryo
- Stinger cryostat from ColdEdge, controlled by an automated valve manifold with custom driver.
- Working with instrument objects
- Local base directory and local settings
- Creating a new instrument class
- Creating an app-based GUI
The main classes of the project are located in the root directory, each class in a separate folder starting from "@" (MATLAB standard). Particular instrument and analysis routine classes are grouped in dedicated folders. By convention, we also store instrument GUIs separately, in the "GUIs" folder, as they are sometimes used by more than one instrument class. All functions are stored under "Utility functions". "Test tools" contains dummy instrument objects and functions which are useful for debugging in the absence of physical instruments. "Required packages" contains external code directly used in the project and license agreements for the code that was reused with modifications. Everything that is not code (e.g. graphics) is stored in "Resources".
The code mostly follows naming conventions
GUI utilities
-
MyDaqMenu
- root GUI that provides interface to start instrument control panels,MyDaq
and any other routines specified by "run" files in the local base directory. -
MyInstrumentManager
- app-based interface to local settings that store the information about connected instruments and their parameters.
Data structures
-
MyTrace
– data structure that represents a list of y(x) values with additional information about units, acquisition conditions etc. -
MyAvgTrace
– derivative ofMyTrace
with averaging capabilities -
MyLog
– data structure which represents a record of vector values [t, y1(t), y2(t), y3(t), ...]. -
MyMetadata
– object which is capable of storing and saving a wide range of MATLAB data in a readable format, including numerical and character arrays, cell arrays and structures with arbitrary nesting. Used as a part ofMyTrace
andMyLog
, also instruments return measurement headers in the form of this object.
Instrument superclasses
-
MyDataSource
– class, defining the necessary minimum for being able to transfer data toMyDaq
-
MyCommCont
– class, providing high-level capabilities for robust textual command-based communication -
MyInstrument
– class that implements commands structure -
MyScpiInstrument
– extended capabilities to work with SCPI communication -
MyZiLockIn
– initialization of a Zurich Instruments lock-in data server
Measurement routines
-
MyZiRingdown
– program for ringdown measurements of mechanical quality factors -
MyZiScopeFt
– fft spectrum analyzer using a Zurich Instruments lock-in
Fits
-
MyFit
– superclass for the creation of fitting routines with interactive capabilities -
MyFitParamScaling
–MyFit
with added rescaling of data in order to improve the convergence and make the fits insensitive to the absolute magnitude of data. Abstract class, requires the definition of scaling/unscaling functions in the subclasses.
Other classes
-
MyGuiSync
– contains a mechanism for the synchronization of values of class properties and GUI elements (numeric edit fields, list boxes etc). Apps that provide user interface to existing classes and are well decoupled from their implementation can be created in this way. See creating an app based GUI. -
MySingleton
– superclass of singleton classes that are allowed to have only one instance at a time.MyCollector
is a singleton class. -
MyClassParser
– extends the capabilities of MATLABinputParser
to handle the assignment of class properties, these objects are used in constructors of other classes. -
MyNewDataEvent
– derivative of MATLABevent.EventData
that is is sent toMyDaq
withNewData
event by instrument objects. Among other, contains the trace to be transferred. -
MyNewpUsbComm
– used to implement blocking communication with Newport usb driver, for example, inMyNewpTlb6700
.
- Tools for manipulations with local settings
runInstrument
var2str
-
printSubs
,str2substruct
andsubstruct2str
-
dirfind
- a straightforward but useful tool to track code dependencies