Skip to content

Latest commit

 

History

History
144 lines (121 loc) · 14.1 KB

devices.rst

File metadata and controls

144 lines (121 loc) · 14.1 KB

Specific device classes

General concepts

Most devices share common methods and approach to make them more predictable and easier to use.

First, the device identifier / address needs to be provided by user during the device object creation, and it is automatically connected. The devices have open and close methods but the device also works as a resource (with Python with statement), so these usually aren't used explicitly.

The devices usually have get_settings and apply_settings methods which return Python dictionaries with the most common settings or take these dictionaries and apply them. In addition, there are get_full_status and get_full_info functions, which return progressively more information (get_full_status adds variable status information which cannot be changed by user, and get_full_info adds constant device information, such as model name and serial number). get_full_info can be particularly useful to check the device status and see if it is connected and working properly.

Devices of the same kind (e.g., cameras or translation stages) aim to have consistent overlapping interfaces (where it makes sense), so different devices are fairly interchangeable in simple applications.

Examples

Connecting to a Cryomagnetics LM500 level meter and reading out the level at the first channel:

from pylablib.aux_libs.devices import Cryomagnetics  # import the device library
# Next, create the device object and connect to the device;
#   the connection is automatically opened on creation, and closed when the ``with`` block is ended
with Cryomagnetics.LM500("COM1") as lm:
    level = lm.get_level(1)  # read the level

Stepping the M Squared laser wavelength and recording an image from the Andor IXON camera at each step:

from pylablib.aux_libs.devices import M2, Andor  # import the device libraries
with M2.M2ICE("192.168.0.1", 39933) as laser, Andor.AndorCamera() as cam:  # connect to the devices
    # change some camera parameters
    cam.set_shutter("open")
    cam.set_exposure(50E-3)
    cam.set_amp_mode(preamp=2)
    cam.set_EMCCD_gain(128)
    cam.setup_image_mode(vbin=2, hbin=2)
    # setup acquisition mode
    cam.set_acquisition_mode("cont")
    cam.setup_cont_mode()
    # start camera acquisition
    cam.start_acquisition()
    wavelength = 740E-9  # initial wavelength (in meters)
    images = []
    while wavelength < 770E-9:
        laser.tune_wavelength_table(wavelength)  # tune the laser frequency (using coarse tuning)
        time.sleep(0.5)  # wait until the laser stabilizes
        cam.wait_for_frame()  # ensure that there's a frame in the camera queue
        frame = cam.read_newest_image()
        images.append(frame)
        wavelength += 0.5E-9

List of devices

Device Kind Module Comments
M Squared ICE BLOC Laser M2 <pylablib.aux_libs.devices.M2>

Pure Photonics PPCL200 Lighthouse Photonics SproutG LaserQuantum Finesse laser Agilent HP8168F Nuphoton NP2000 HighFinesse WS/6 and WS/7

Laser Laser Laser Laser EDFA Wavemeter

PurePhotonics <pylablib.aux_libs.devices.PurePhotonics> LighthousePhotonics <pylablib.aux_libs.devices.LighthousePhotonics> LaserQuantum <pylablib.aux_libs.devices.LaserQuantum> AgilentLasers <pylablib.aux_libs.devices.AgilentLasers> NuPhoton <pylablib.aux_libs.devices.NuPhoton> HighFinesse <pylablib.aux_libs.devices.HighFinesse>

In CBDX1 chassis

Andor Shamrock Spectrometer Andor <pylablib.aux_libs.devices.AndorShamrock>

Tested with Andor SR-303i

Andor SDK2 interface Camera Andor <pylablib.aux_libs.devices.Andor> Tested with Andor IXON and Luca
Andor SDK3 interface Camera Andor <pylablib.aux_libs.devices.Andor> Tested with Andor Zyla
Hamamatsu DCAM interface Camera DCAM <pylablib.aux_libs.devices.DCAM> Tested with ORCA-Flash 4.0 (C11440-22CU)
NI IMAQdx interface Camera IMAQdx <pylablib.aux_libs.devices.IMAQdx> Tested with Photon Focus HD1-D1312 with GigE connection
NI IMAQ interface Camera IMAQ <pylablib.aux_libs.devices.IMAQ> Tested with NI PCI-1430 frame grabber
Photon Focus PFCam interface Camera PhotonFocus <pylablib.aux_libs.devices.PhotonFocus> Tested with MV-D1024E and CameraLink connection with NI PCIe-1433 frame grabber (via IMAQ)

PCO SC2 interface Ophir Vega Thorlabs PM100D OZ Optics TF100 OZ Optics DD100 OZ Optics EPC04 Agilent AWG33220A Agilent N9310A Vaunix LMS (Lab Brick) Thorlabs MDT693/4A Agilent AMP33502A Rigol DSA1030A Agilent HP8712B, HP8722D Tektronix DPO2014, TDS2000, MDO3000

Camera Optical power meter Optical power meter Tunable optical filter Variable optical attenuator Polarization controller Arbitrary waveform generator Microwave generator Microwave generator High voltage source DC amplifier Microwave spectrum analyzer Vector network analyzers Oscilloscopes

PCO_SC2 <pylablib.aux_libs.devices.PCO_SC2> Ophir <pylablib.aux_libs.devices.Ophir> Thorlabs <pylablib.aux_libs.devices.Thorlabs> OZOptics <pylablib.aux_libs.devices.OZOptics> OZOptics <pylablib.aux_libs.devices.OZOptics> OZOptics <pylablib.aux_libs.devices.OZOptics> AgilentElectronics <pylablib.aux_libs.devices.AgilentElectronics> AgilentElectronics <pylablib.aux_libs.devices.AgilentElectronics> Vaunix <pylablib.aux_libs.devices.Vaunix> Thorlabs <pylablib.aux_libs.devices.Thorlabs> AgilentElectronics <pylablib.aux_libs.devices.AgilentElectronics> Rigol <pylablib.aux_libs.devices.Rigol> AgilentElectronics <pylablib.aux_libs.devices.AgilentElectronics> Tektronix <pylablib.aux_libs.devices.Tektronix>

Tested with PCO.edge 5.5 CL and PCO.edge CLHS

NI DAQ interface Zurich Instruments HF2 / UHF

NI DAQ devices Lock-in amplifiers

NI <pylablib.aux_libs.devices.NI> ZurichInstruments <pylablib.aux_libs.devices.ZurichInstruments>

Wrapper around the nidaqmx package. Tested with NI USB-6008 and NI PCIe-6323

Arcus PerforMax SmarAct SCU3D

Translation stage Translation stage

Arcus <pylablib.aux_libs.devices.Arcus> SmarAct <pylablib.aux_libs.devices.SmarAct>

Tested with PMX-4EX-SA stage.

Attocube ANC300 Piezo slider controller Attocube <pylablib.aux_libs.devices.Attocube> Only tested with Ethernet or Serial connection

Attocube ANC350 Trinamic TMCM1110 Thorlabs KDC101 Thorlabs K10CR1 Thorlabs FW102/202 Thorlabs MFF Cryomagnetics LM500/510 Lakeshore 218 and 370 MKS 9xx Pfeiffer TPG261

Piezo slider controller Stepper motor controller DC servo motor controller Motorized rotation mount Motorized filter wheel Motorized flip mount Cryogenic level meter Temperature controllers Pressure gauge Pressure gauge

Attocube <pylablib.aux_libs.devices.Attocube> Trinamic <pylablib.aux_libs.devices.Trinamic> Thorlabs <pylablib.aux_libs.devices.Thorlabs> Thorlabs <pylablib.aux_libs.devices.Thorlabs> Thorlabs <pylablib.aux_libs.devices.Thorlabs> Thorlabs <pylablib.aux_libs.devices.Thorlabs> Cryomagnetics <pylablib.aux_libs.devices.Cryomagnetics> Lakeshore <pylablib.aux_libs.devices.Lakeshore> MKS <pylablib.aux_libs.devices.MKS> Pfeiffer <pylablib.aux_libs.devices.Pfeiffer>

Only tested with USB connection

All the modules are located in pylablib.aux_libs.devices.

Additional requirements

First, any device using PyVISA require NI VISA to be installed. See PyVISA for details.

Second, some devices need dlls supplied by the manufacturer:

  • Andor SDK2 cameras: require atmcd.dll (currently supplied for x64 and x86). Can be obtained with Andor Solis software, or Andor SDK. If Andor Solis is installed in the default location (C:/Program Files/Andor Solis), these dlls are accessed automatically. It might be called atmcd64d_legacy.dll or atmcd32d_legacy.dll (depending on the Solis version and Python bitness), but it needs to be renamed to atmcd.dll when placed into aux_libs/devices/libs/x64 (or x32) folder.
  • Andor SDK3 cameras: require several `at*.dll`: atcore.dll, atblkbx.dll, atcl_bitflow.dll, atdevapogee.dll, atdevregcam.dll, atusb_libusb.dll, atusb_libusb10.dll (currently supplied only for x64). Has potential incompatibilities between different versions of Windows; tested with Windows 7 x64 and Andor Solis 4.30.30034.0. Can be obtained with Andor Solis software. If Andor Solis is installed in the default location (C:/Program Files/Andor Solis), these dlls are accessed automatically.
  • PCO SC2 cameras: require several `SC2*.dll`: SC2_Cam.dll, sc2_cl_me4.dll, sc2_cl_mtx.dll, sc2_cl_nat.dll, sc2_cl_ser.dll, sc2_clhs.dll. These are provided with pco.sdk, which can be obtained on PCO website.
  • Arcus PerforMax translation stages: require PerformaxCom.dll and SiUSBXp.dll. Can be obtained from Arcus website, either at USB 64-bit DLL (for 64-bit systems), or inside Python USB source (for 32-bit systems)
  • HighFinesse WS/6 and WS/7 wavemeters: require wlmData.dll. Each device needs a unique dll supplied by the manufacturer. One can either supply DLL path on creation of the device class, or place it into aux_libs/devices/libs/x64 (or x32) folder; in the latter case, it should be renamed to wlmData6.dll or wlmData7.dll depending on the wavemeter model (WS/6 or WS/7).
  • SmarAct SCU3D translation stage controller: requires SCU3DControl.dll. Should be supplied with the device by the manufacturer.

For the application to have access to them, they need to be placed into the package folder (correspondingly, into aux_libs/devices/libs/ inside the main package folder, which is usually something like Python36/Lib/site-packages/pylablib/).

Third, some devices need additional software installed:

  • IMAQ cameras: National Instruments IMAQ library.
  • IMAQdx cameras: National Instruments IMAQdx library.
  • Photon Focus cameras: Photon Focus PFRemote software.
  • Hamamatsu DCAM cameras: DCAM software (Hamamatsu HOKAWO) and drivers.
  • Andor cameras: Andro Solis software and drivers
  • NI DAQs: National Instruments NI-DAQmx library (with C support; just Runtime is sufficient).
  • HighFinesse: manufacturer-provided drivers and software (specific to the particular wavemeter).
  • Thorlabs Kinesis devices (KFF, KDC101, K10CR1): Kinesis/APT software.
  • Trinamic hardware: Trinamic TMCL-IDE (needed to install device drivers)
  • Arcus PerforMax software: Arcus Drivers and Tools, Arcus USB Series and Arcus Performax Series software (needed to install device drivers).
  • Zurich Instruments: manufacturer provided software and Python libraries.

The list might be incomplete, and it does not include drivers for all USB devices.