pylablib.devices.Standa package

Submodules

pylablib.devices.Standa.base module

exception pylablib.devices.Standa.base.StandaError[source]

Bases: DeviceError

Generic Standa device StandaError

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.

exception pylablib.devices.Standa.base.StandaBackendError(exc)[source]

Bases: StandaError, DeviceBackendError

Generic Standa backend communication 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.

class pylablib.devices.Standa.base.TEngineType(engine, driver)

Bases: tuple

driver
engine
class pylablib.devices.Standa.base.TStepperMotorCalibration(steps_per_rev, usteps_per_step)

Bases: tuple

steps_per_rev
usteps_per_step
class pylablib.devices.Standa.base.TFullState(smov, scmd, spwr, senc, swnd, position, encoder, speed, ivpwr, ivusb, temp, flags, gpio)

Bases: tuple

encoder
flags
gpio
ivpwr
ivusb
position
scmd
senc
smov
speed
spwr
swnd
temp
class pylablib.devices.Standa.base.TMoveParams(speed, accel, decel, antiplay)

Bases: tuple

accel
antiplay
decel
speed
class pylablib.devices.Standa.base.TPowerParams(hold_current, reduct_enabled, reduct_delay, off_enabled, off_delay, ramp_enabled, ramp_time)

Bases: tuple

hold_current
off_delay
off_enabled
ramp_enabled
ramp_time
reduct_delay
reduct_enabled
class pylablib.devices.Standa.base.Standa8SMC(conn)[source]

Bases: ICommBackendWrapper, IStage

Generic Standa 8SMC4/8SMC5 controller device.

Parameters:

conn – serial connection parameters (usually port, a tuple containing port and baudrate, or a tuple with full specification such as ("COM1", 115200, 8, 'N', 2))

Error

alias of StandaError

query(cmd, data=b'', retlen=None)[source]
pquery(cmd, *args)[source]
get_engine_type()[source]

Get engine and driver type

get_stepper_motor_calibration()[source]

Get stepper motor calibration parameters.

Return tuple (steps_per_rev, usteps_per_step).

get_status()[source]

Get device status.

Return tuple (smov, scmd, spwr, senc, swnd, position, encoder, speed, ivpwr, ivusb, temp, flags, gpio) with the moving state (whether motor is moving, reached speed, etc.), command state (last issued command and its status), power state, encoder state, winding state (currently not used), step position, encoder position, current speed, current and voltage of the power supply, current and voltage of the USB source, temperature (in C), and additional state and GPIO flags.

is_moving()[source]

Check if the motor is moving

wait_move(timeout=None)[source]

Wait until motion is done

get_position()[source]

Return step position (in steps for a DC motor, in microsteps for a stepper motor)

get_encoder()[source]

Return encoder position

set_position_reference(position=0)[source]

Set position reference (in steps for a DC motor, in microsteps for a stepper motor).

Actual motor position stays the same.

set_encoder_reference(position=0)[source]

Set encoder reference.

Actual motor position stays the same.

move_to(position)[source]

Move to the given position (in steps for a DC motor, in microsteps for a stepper motor)

move_by(distance)[source]

Move by the given distance (in steps for a DC motor, in microsteps for a stepper motor)

stop(immediate=False)[source]
power_off(stop='soft')[source]
jog(direction)[source]

Start moving in a given direction ("+" or "-")

home(sync=True, timeout=30.0)[source]

Home the motor.

If sync==True, wait until the homing is complete, or until timeout expires.

get_move_parameters()[source]

Get moving parameters.

Return tuple (speed, accel, decel, antiplay).

setup_move(speed=None, accel=None, decel=None, antiplay=None)[source]

Setup moving parameters.

If any parameter is None, use the current value.

get_power_parameters()[source]

Get power parameters.

Return tuple (hold_current, reduct_enabled, reduct_delay, off_enabled, off_delay, ramp_enabled, ramp_time).

setup_power(hold_current=None, reduct_enabled=None, reduct_delay=None, off_enabled=None, off_delay=None, ramp_enabled=None, ramp_time=None)[source]

Setup power parameters.

If any parameter is None, use the current value.

apply_settings(settings)

Apply the settings.

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

close()

Close the backend

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".

is_opened()

Check if the device is connected

lock(timeout=None)

Lock the access to the device from other threads/processes (isn’t necessarily implemented)

locking(timeout=None)

Context manager for lock & unlock

open()

Open the backend

set_device_variable(key, value)

Set the value of a settings parameter

unlock()

Unlock the access to the device from other threads/processes (isn’t necessarily implemented)

Module contents