microscope.controllers.zaber module

Zaber devices.

Devices supported

There is support for A-Series and X-Series devices that have firmware version 6.06 or higher, as these are the ones who support the ASCII protocol.

class microscope.controllers.zaber.ZaberDaisyChain(port: str, address2type: Mapping[int, microscope.controllers.zaber.ZaberDeviceType], **kwargs)[source]

Bases: microscope.abc.Controller

A daisy chain of Zaber devices.

Parameters
  • port – the port name to connect to. For example, COM1, /dev/ttyUSB0, or /dev/cuad1.

  • address2type – a map of device addresses to the corresponding ZaberDeviceType.

Zaber devices can be daisy-chained, i.e., a set of Zaber devices can be connected in a sequence so that each device is only wired to the previous and next device in the sequence, and only the first device in the sequence is connected to the computer. Even if there is only Zaber device, this is modelled as a one element daisy-chain. If there are multiple devices, all connected directly to the computer, i.e., not chained, then each device is its own one-element daisy-chain.

from microscope.controllers.zaber import ZaberDaisyChain, ZaberDeviceType
zaber = ZaberDaisyChain("/dev/ttyUSB0",
                        {2: ZaberDeviceType.STAGE,
                         3: ZaberDeviceType.LED_CONTROLLER,
                         4: ZaberDeviceType.FILTER_WHEEL})

# Device names are strings, not int.
filterwheel = zaber.devices['4']

# LEDs are not devices of the zaber daisy chain, they are
# devices of the LED controller.
led_controller = zaber.devices['3']
led1 = led_controller.devices['LED1']

# Stage axis names are the string of the axis number.
xy_stage = zaber.devices['2']
motor1 = xy_stage.axes['1']

Each device on a chain is identified by a device address which is an integer between 1 and 99. By default, the addresses start at 1 and are sorted by distance to the computer, but this can be changed.

For an LED controller device, the names of its devices are “LED1”, “LED2”, etc, the same as the labels on the LED controller itself.

Because there is no method to correctly guess a device type, a map of device addresses to device types is required.

Note

Zaber devices need to be homed before they can be moved. A stage will be homed during enable but a filter wheel will be homed during the object construction.

property devices

Map of names to the controlled devices.

class microscope.controllers.zaber.ZaberDeviceType(value)[source]

Bases: enum.Enum

Enumerator for Zaber device types.

This enum is used to specify the type of device for each address when constructing a ZaberDaisyChain.

FILTER_WHEEL = <class 'microscope.controllers.zaber._ZaberFilterWheel'>
LED_CONTROLLER = <class 'microscope.controllers.zaber._ZaberLEDController'>
STAGE = <class 'microscope.controllers.zaber._ZaberStage'>