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, setuninit_result=None
- pylablib.devices.SmarAct.MCS2.get_devices_number()[source]
Get number of connected SmarAct MCS2 controller
- 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.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
- 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"
.
- 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"
- is_moving(axis=None)[source]
Check if a given axis is moving (including referencing and calibrating)
- 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 callmove_by()
method withdistance=0
for the appropriate axis. If any parameter isNone
, 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 isNone
, 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 isNone
, 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 orNone
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, orNone
otherwise.
- 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
- 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
- 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, settinginclude=-10
queries all available variables, which is equivalent toinclude="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, settinginclude=-10
queries all available variables, which is equivalent toinclude="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, settinginclude=-10
queries all available variables, which is equivalent toinclude="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
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, setuninit_result=None
- 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.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:
- Error = <Mock name='mock.SmarActError' id='139946267829776'>
- 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).
- 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, settinginclude=-10
queries all available variables, which is equivalent toinclude="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, settinginclude=-10
queries all available variables, which is equivalent toinclude="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, settinginclude=-10
queries all available variables, which is equivalent toinclude="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