pylablib.devices.SmarAct package

Submodules

pylablib.devices.SmarAct.MCS2 module

class pylablib.devices.SmarAct.MCS2.LibraryController(lib)[source]

Bases: LibraryController

close(opid)[source]

Mark device closing.

Return tuple (close_result, uninit_result) with the results of the closing and the shutdown. If library does not need to be shut down yet, set uninit_result=None

get_opened_num()[source]

Get number of opened devices

open()[source]

Mark device opening.

Return tuple (init_result, open_result, opid) with the results of the initialization and the opening, and the opening ID which should afterwards be used for closing. If library is already initialized, set init_result=None

preinit()[source]

Pre-initialize the library, if it hasn’t been done already

shutdown()[source]

Close all opened connections and shutdown the library

temp_open()[source]

Context for temporarily opening a new device connection

pylablib.devices.SmarAct.MCS2.list_devices()[source]

List all connected SmarAct MCS2 devices

pylablib.devices.SmarAct.MCS2.get_devices_number()[source]

Get number of connected SmarAct MCS2 controller

pylablib.devices.SmarAct.MCS2.get_SDK_version()[source]

Get version of MCS2 SDK

class pylablib.devices.SmarAct.MCS2.TDeviceInfo(serial, name)

Bases: tuple

name
serial
class pylablib.devices.SmarAct.MCS2.TCLMoveParams(velocity, acceleration, max_step_frequency, hold_time)

Bases: tuple

acceleration
hold_time
max_step_frequency
velocity
class pylablib.devices.SmarAct.MCS2.TStepMoveParams(frequency, amplitude)

Bases: tuple

amplitude
frequency
class pylablib.devices.SmarAct.MCS2.TScanMoveParams(velocity)

Bases: tuple

velocity
class pylablib.devices.SmarAct.MCS2.MCS2(locator)[source]

Bases: IMultiaxisStage

SmarAct MCS2 translation stage controller.

Parameters:

locator (str) – controller locator (returned by get_devices_number() function)

Error

alias of SmarActError

open()[source]

Open the connection to the stage

close()[source]

Close the connection to the stage

is_opened()[source]

Check if the device is connected

get_property(name, idx=0)[source]

Get stage property with the given name and index

get_all_properties(scope='all', idx='all')[source]

Get all controller properties within the given scope and for the given index.

scope can be "dev" (device properties), "mod" (module properties), "cha" (channel properties), or "api" (api properties); it can also be a list of several scopes, or "all", which includes all properties. idx is the index and usually applies to "cha" or "mod" scopes; for other scopes it should be set to 0 or "all".

set_property(name, value, idx=0)[source]

Set stage property with the given name and index

get_device_info()[source]

Get the device info of the controller board.

Return tuple (serial, name).

get_default_axis()[source]

Get the default axis (the one automatically applied to channel-related methods)

set_default_axis(axis)[source]

Set the default axis (the one automatically applied to channel-related methods).

Can be a zero-based axis index or "all"

using_default_axis(axis)[source]

Context manager for temporarily changing the default axis

get_status_n(axis=None)[source]

Get axis status as an integer

get_status(axis=None)[source]

Get axis status as a set of string descriptors

is_moving(axis=None)[source]

Check if a given axis is moving (including referencing and calibrating)

wait_move(axis, timeout=30.0)[source]

Wait for a given axis to stop moving

get_device_status_n()[source]

Get device status as an integer

get_device_status()[source]

Get axis status as a set of string descriptors

get_module_status_n(index=0)[source]

Get module status as an integer

get_module_status(index)[source]

Get module status as a set of string descriptors

get_cl_move_parameters(axis=None)[source]

Get closed-loop move parameters.

Return tuple (velocity, acceleration, max_step_frequency, hold_time) with the maximal move velocity (in m/s or deg/s), move acceleration (in m/s^2 or deg/s^2), maximal step frequency (in Hz), and position hold time (in s, or "inf" if it is infinite)

setup_cl_move(velocity=None, acceleration=None, max_step_frequency=None, hold_time=None, axis=None)[source]

Set closed-loop move parameters.

For the meaning of the parameters, see get_cl_move_parameters(). Note that changing the hold time will only apply after the next move command. To apply it without actual moving, you can call move_by() method with distance=0 for the appropriate axis. If any parameter is None, use the current value.

get_step_move_parameters(axis=None)[source]

Get step move parameters.

Return tuple (frequency, amplitude) with the step frequency (in Hz) and step amplitude (normalized between 0 and 1).

setup_step_move(frequency=None, amplitude=None, axis=None)[source]

Set step move parameters.

For the meaning of the parameters, see get_step_move_parameters(). If any parameter is None, use the current value.

get_scan_move_parameters(axis=None)[source]

Get scan move parameters.

Return tuple (velocity) with the move velocity (amplitude per second; amplitude is normalized between 0 and 1).

setup_scan_move(velocity=None, axis=None)[source]

Set scan move parameters.

For the meaning of the parameters, see get_scan_move_parameters(). If any parameter is None, use the current value.

get_range_limit(axis=None)[source]

Get the movement range limit (in m or deg) for the given axis.

Return (min, max) if the limit is active or None otherwise.

set_range_limit(limit, axis=None)[source]

Set the movement range limit (in m or deg) for the given axis.

limit is either a tuple (min, max) if the limit is active, or None otherwise.

get_position(axis=None)[source]

Get current position (in m or deg) at the given axis

set_position_reference(position=0, axis=None)[source]

Get the current position (in m or deg) at the given axis.

This method simply shifts the position sensor reference; the stage does not move.

get_scan_position(axis=None)[source]

Get current scan position (piezo voltage; normalized between 0 and 1) at the given axis

get_target_position(axis=None)[source]

Get current target position (in m or deg) at the given axis

move_to(position, axis=None)[source]

Move to the given position (in m or deg) at the given axis

move_by(distance, axis=None)[source]

Move by the given distance (in m or deg) at the given axis

move_by_steps(steps, axis=None)[source]

Move by the given number of steps at the given axis

move_scan_to(position, axis=None)[source]

Move to the given open-loop position (piezo voltage; normalized between 0 and 1) using just a piezo deflection at the given axis

move_scan_by(distance, axis=None)[source]

Move by the given open-loop distance (piezo voltage; normalized between -1 and 1) using just a piezo deflection at the given axis

stop(axis=None)[source]

Stop motion at the given axis

home(axis=None, sync=True, start_direction='+', reverse_direction=False, abort_on_stop=False, auto_zero=False, continue_on_found=False, stop_on_found=False)[source]

Home (reference) the given axis.

If sync==True, wait until the homing is done. The other parameters are flags setting up the referencing behavior. See MCS2 programming manual section on reference marks for the details.

calibrate(axis=None, sync=True, direction='+', detect_code_inversion=False, advanced_sensor_correction=False, limited_stage_range=False)[source]

Calibrate the given axis.

If sync==True, wait until the calibration is done. The other parameters are flags setting up the calibration behavior. See MCS2 programming manual section on calibrating for the details.

lowlevel_move(value, axis=None)[source]

Execute the low-level movement command with the given integer value.

The meaning of the value depends on the devices properties (see MCS2 programming manual for the details). This is a low-level method, whose high-level functionality is covered by other move methods.

lowlevel_reference(axis=None)[source]

Execute the low-level reference command with the given integer value.

Exact procedure depends on the devices properties (see MCS2 programming manual for the details). This is a low-level method, whose high-level functionality is covered by the home() method.

lowlevel_calibrate(axis=None)[source]

Execute the low-level calibration command with the given integer value.

Exact procedure depends on the devices properties (see MCS2 programming manual for the details). This is a low-level method, whose high-level functionality is covered by the calibrate() method.

apply_settings(settings)

Apply the settings.

settings is the dict {name: value} of the device available settings. Non-applicable settings are ignored.

get_all_axes()

Get the list of all available axes (taking mapping into account)

get_device_variable(key)

Get the value of a settings, status, or full info parameter

get_full_info(include=0)

Get dict {name: value} containing full device information (including status and settings).

include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or "all" (all available variables). Since the lowest priority is -10, setting include=-10 queries all available variables, which is equivalent to include="all".

get_full_status(include=0)

Get dict {name: value} containing the device status (including settings).

include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or "all" (all available variables). Since the lowest priority is -10, setting include=-10 queries all available variables, which is equivalent to include="all".

get_settings(include=0)

Get dict {name: value} containing all the device settings.

include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or "all" (all available variables). Since the lowest priority is -10, setting include=-10 queries all available variables, which is equivalent to include="all".

remap_axes(mapping, accept_original=True)

Rename axes to the new labels.

mapping is the new axes mapping, which can be a list of new axes name (corresponding to the old axes in order returned by get_all_axes()), or a dictionary {alias: original} of the new axes aliases.

set_device_variable(key, value)

Set the value of a settings parameter

pylablib.devices.SmarAct.base module

exception pylablib.devices.SmarAct.base.SmarActError[source]

Bases: DeviceError

Generic SmarAct error

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

pylablib.devices.SmarAct.scu3d module

class pylablib.devices.SmarAct.scu3d.LibraryController(lib)[source]

Bases: LibraryController

close(opid)[source]

Mark device closing.

Return tuple (close_result, uninit_result) with the results of the closing and the shutdown. If library does not need to be shut down yet, set uninit_result=None

get_opened_num()[source]

Get number of opened devices

open()[source]

Mark device opening.

Return tuple (init_result, open_result, opid) with the results of the initialization and the opening, and the opening ID which should afterwards be used for closing. If library is already initialized, set init_result=None

preinit()[source]

Pre-initialize the library, if it hasn’t been done already

shutdown()[source]

Close all opened connections and shutdown the library

temp_open()[source]

Context for temporarily opening a new device connection

class pylablib.devices.SmarAct.scu3d.TDeviceInfo(device_id, firmware_version, dll_version)

Bases: tuple

device_id
dll_version
firmware_version
pylablib.devices.SmarAct.scu3d.get_device_info(idx)[source]

Get info of the devices with the given index.

Return tuple (device_id, firmware_version, dll_version).

pylablib.devices.SmarAct.scu3d.list_devices()[source]

List all connected devices

pylablib.devices.SmarAct.scu3d.get_devices_number()[source]

Get number of connected SCU3D controller

class pylablib.devices.SmarAct.scu3d.SCU3D(idx=0, axis_dir='+++')[source]

Bases: IMultiaxisStage

SmarAct SCU3D translation stage controller.

Parameters:
  • idx (int) – stage index

  • axis_dir (str) – 3-symbol string specifying default directions of the axes (each symbol be "+" or "-")

Error = <Mock name='mock.SmarActError' id='139946267829776'>
open()[source]

Open the connection to the stage

close()[source]

Close the connection to the stage

is_opened()[source]

Check if the device is connected

get_device_info()[source]

Get info of the devices with the given index.

Return tuple (device_id, firmware_version, dll_version).

get_axis_dir()[source]

Get axis direction convention (a string of 3 symbols which are either "+" or "-" determining if the axis direction is flipped)

set_axis_dir(axis_dir)[source]

Set axis direction convention (a string of 3 symbols which are either "+" or "-" determining if the axis direction is flipped)

move_macrostep(axis, steps, voltage, frequency)[source]

Move along a given axis by a single “macrostep”, which consists of several regular steps.

voltage (in Volts) and frequency (in Hz) specify the motion parameters. This simulates the controller operation, where one “step” at large step sizes consists of several small steps.

move_by(axis, steps=1, stepsize=10)[source]

Move along a given axis with a given number of macrosteps using one of the predefined step size.

stepsize can range from 1 (smallest) to 20 (largest), and roughly corresponds to the handheld controller parameters.

get_status(axis='all')[source]

Get the axis status.

Can be "stopped" (default state), "setting_amplitude" (setting open-loop step amplitude), "moving" (open-loop movement), "targeting" (closed-loop movement), "holding" (closed-loop position holding), "calibrating" (sensor calibration), or "moving_to_reference" (calibrating position sensor).

wait_for_status(axis, status='stopped', timeout=30.0)[source]

Wait until the axis reaches a given status.

By default wait for "stopped" status (i.e., wait until the motion is finished).

wait_move(axis, timeout=30.0)[source]

Wait for a given axis to stop moving

is_moving(axis='all')[source]

Check if a given axis is moving

stop(axis='all')[source]

Stop motion at a given axis

apply_settings(settings)

Apply the settings.

settings is the dict {name: value} of the device available settings. Non-applicable settings are ignored.

get_all_axes()

Get the list of all available axes (taking mapping into account)

get_device_variable(key)

Get the value of a settings, status, or full info parameter

get_full_info(include=0)

Get dict {name: value} containing full device information (including status and settings).

include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or "all" (all available variables). Since the lowest priority is -10, setting include=-10 queries all available variables, which is equivalent to include="all".

get_full_status(include=0)

Get dict {name: value} containing the device status (including settings).

include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or "all" (all available variables). Since the lowest priority is -10, setting include=-10 queries all available variables, which is equivalent to include="all".

get_settings(include=0)

Get dict {name: value} containing all the device settings.

include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or "all" (all available variables). Since the lowest priority is -10, setting include=-10 queries all available variables, which is equivalent to include="all".

remap_axes(mapping, accept_original=True)

Rename axes to the new labels.

mapping is the new axes mapping, which can be a list of new axes name (corresponding to the old axes in order returned by get_all_axes()), or a dictionary {alias: original} of the new axes aliases.

set_device_variable(key, value)

Set the value of a settings parameter

Module contents