API Reference

ElliptecBus

exception ElliptecBus.elliptec_bus.ElliptecError[source]

Bases: Exception

Base exception for Elliptec communication and device errors.

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 ElliptecBus.elliptec_bus.ElliptecTimeoutError[source]

Bases: ElliptecError

Raised when the device does not respond in time.

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 ElliptecBus.elliptec_bus.ElliptecProtocolError[source]

Bases: ElliptecError

Raised when an unexpected or malformed packet is received.

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 ElliptecBus.elliptec_bus.ElliptecDeviceError(code, message)[source]

Bases: ElliptecError

Raised when a device returns a non-zero GS status.

__init__(code, message)[source]

Build an exception from a GS status code and its text description.

Parameters:
  • code (int) – Input value for this operation.

  • message (str) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
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 ElliptecBus.elliptec_bus.Packet(raw, address, command, data)[source]

Bases: object

Parsed Elliptec frame: <address><command><hex-ascii-data>.

raw
address
command
data
class ElliptecBus.elliptec_bus.ElliptecBus(port, *, baudrate=9600, timeout=0.25, write_timeout=1.0, settle_delay=0.02, auto_connect=True)[source]

Bases: object

Shared serial bus for one ELLC / ELLB / distribution-board connection.

One bus instance owns exactly one COM port. Multiple device wrappers can share this bus safely by using addressed commands and bus transactions.

DEFAULT_BAUDRATE = 9600
DEFAULT_TIMEOUT = 0.25
DEFAULT_WRITE_TIMEOUT = 1.0
DEFAULT_SETTLE_DELAY = 0.02
__init__(port, *, baudrate=9600, timeout=0.25, write_timeout=1.0, settle_delay=0.02, auto_connect=True)[source]

Create a bus bound to one serial interface.

Parameters:
  • port (str) – Input value for this operation.

  • baudrate (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

  • write_timeout (float) – Input value for this operation.

  • settle_delay (float) – Input value for this operation.

  • auto_connect (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
connect()[source]

Open the serial port and initialize bus buffers.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # connect(...)
close()[source]

Close the serial port owned by this bus instance.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # close(...)
property is_connected

Return True when the underlying serial handle is open.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
classmethod available_ports()[source]

Enumerate serial ports currently visible to the OS.

Returns:

Result produced by this function.

Return type:

List[str]

Example

>>> # Example
>>> # available_ports(...)
flush_buffers()[source]

Purge RX/TX buffers to discard pending bytes on the transport.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # flush_buffers(...)
transaction()[source]

Hold exclusive access to the shared bus for a full multi-step exchange.

Returns:

Result produced by this function.

Return type:

Iterator[‘ElliptecBus’]

Example

>>> # Example
>>> # transaction(...)
write(payload, *, address=None)[source]

Send one host command frame.

Parameters:
  • payload (str) – Input value for this operation.

  • address (Optional[Union[str, int]]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # write(...)
read_packet(*, timeout=None)[source]

Read one device frame terminated by CRLF and parse it.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # read_packet(...)
query(payload, *, address, timeout=None)[source]

Send one command and return the next parsed packet response.

Parameters:
  • payload (str) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # query(...)
query_expect(payload, *, address, expected_command, timeout=None)[source]

Send one command and validate the response address and command mnemonic.

Parameters:
  • payload (str) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • expected_command (str) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # query_expect(...)
command_expect_ok(payload, *, address, timeout=None)[source]

Send a command that is expected to acknowledge with GS00.

Parameters:
  • payload (str) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # command_expect_ok(...)
scan_addresses(addresses='0123456789ABCDEF', *, timeout=0.15)[source]

Probe candidate addresses using in and return addresses that reply with IN.

Parameters:
  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[str]

Example

>>> # Example
>>> # scan_addresses(...)
static parse_packet(raw)[source]

Parse one raw ASCII line into Packet(address, command, data).

Parameters:

raw (str) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # parse_packet(...)
static normalize_address(address)[source]

Normalize address input to a single uppercase hex nibble 0..F.

Parameters:

address (Union[str, int]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # normalize_address(...)
static encode_long(value)[source]

Encode signed 32-bit value as 8 ASCII hex chars (two’s complement).

Parameters:

value (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # encode_long(...)
static decode_long(hex_ascii)[source]

Decode 8 ASCII hex chars into a signed 32-bit integer.

Parameters:

hex_ascii (str) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # decode_long(...)
static decode_word(hex_ascii)[source]

Decode 4 ASCII hex chars into an unsigned 16-bit integer.

Parameters:

hex_ascii (str) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # decode_word(...)
class ElliptecBus.elliptec_models.DeviceInfo(address: 'str', model_code: 'int', serial_number: 'str', year: 'int', firmware_release: 'str', hardware_release: 'int', is_imperial: 'bool', travel: 'int', pulses_per_unit: 'int')[source]

Bases: object

address
model_code
serial_number
year
firmware_release
hardware_release
is_imperial
travel
pulses_per_unit
property model_name

Model name.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # model_name(...)
class ElliptecBus.elliptec_models.MotorInfo(address: 'str', motor_index: 'int', loop_on: 'bool', motor_ok: 'bool', current_raw: 'int', current_amps: 'float', forward_period: 'int', backward_period: 'int')[source]

Bases: object

address
motor_index
loop_on
motor_ok
current_raw
current_amps
forward_period
backward_period

ElliptecBase

ElliptecBase.elliptec_base.parse_in_device_info(packet)[source]

Parse an IN reply frame into DeviceInfo fields.

Parameters:

packet (Packet) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # parse_in_device_info(...)
ElliptecBase.elliptec_base.parse_motor_info_ix(packet, motor_index)[source]

Parse I1/I2 motor info reply into normalized MotorInfo values.

Parameters:
  • packet (Packet) – Input value for this operation.

  • motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # parse_motor_info_ix(...)
ElliptecBase.elliptec_base.parse_gs_status(packet)[source]

Parse GS status/error code from a 2-hex-digit data payload.

Parameters:

packet (Packet) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # parse_gs_status(...)
ElliptecBase.elliptec_base.parse_gs_or_bs_status(packet)[source]

Parse status code from either GS or button-status BS packet.

Parameters:

packet (Packet) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # parse_gs_or_bs_status(...)
ElliptecBase.elliptec_base.parse_long_payload(packet, *, expected_command)[source]

Parse signed 32-bit payload encoded as 8 ASCII hex chars.

Parameters:
  • packet (Packet) – Input value for this operation.

  • expected_command (str) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # parse_long_payload(...)
ElliptecBase.elliptec_base.parse_po_position(packet)[source]

Parse a PO packet position as signed 32-bit pulses.

Parameters:

packet (Packet) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # parse_po_position(...)
ElliptecBase.elliptec_base.validate_motor_index_dual(motor_index)[source]

Validate that motor index is for dual-motor devices (1 or 2).

Parameters:

motor_index (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # validate_motor_index_dual(...)
ElliptecBase.elliptec_base.validate_motor_index_in(motor_index, motors)[source]

Validate that motor index is one of the supported indices for a family.

Parameters:
  • motor_index (int) – Input value for this operation.

  • motors (tuple[int, ...]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # validate_motor_index_in(...)
class ElliptecBase.elliptec_base.ElliptecAddressedDeviceBase(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: object

Shared Elliptec stack wiring: bus, address, IN discovery, and DeviceInfo cache.

Subclasses must define MODEL_CODE and MODEL_FAMILY_NAME.

MODEL_CODE
MODEL_FAMILY_NAME
DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')[source]

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
get_info()[source]

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
class ElliptecBase.elliptec_base.ElliptecGsQueriesMixin[source]

Bases: object

gs read and GS packet parsing.

bus
address
get_status()[source]

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
clear_error()[source]

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
class ElliptecBase.elliptec_base.ElliptecClosedLoopPoGsMixin[source]

Bases: ElliptecGsQueriesMixin

gp position read and PO/GS motion completion.

bus
address
motion_timeout
get_position_pulses()[source]

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
class ElliptecBase.elliptec_base.ElliptecClosedLoopActuatorMixin[source]

Bases: ElliptecClosedLoopPoGsMixin

Home, jog, absolute/relative moves, offsets, velocity, EEPROM, dual-motor info, optimize.

bus
address
motion_timeout
home(direction='cw', *, wait=True, timeout=None)[source]

Send ho to move to home; optionally wait and return final pulse position.

Parameters:
  • direction (str) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # home(...)
move_absolute_pulses(position, *, wait=True, timeout=None)[source]

Send ma absolute move in pulses; optionally wait for final PO.

Parameters:
  • position (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_absolute_pulses(...)
move_relative_pulses(delta, *, wait=True, timeout=None)[source]

Send mr relative move in pulses; optionally wait for final PO.

Parameters:
  • delta (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_relative_pulses(...)
jog_forward(*, wait=True, timeout=None)[source]

Send fw jog/forward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_forward(...)
jog_backward(*, wait=True, timeout=None)[source]

Send bw jog/backward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_backward(...)
stop(*, timeout=None)[source]

Send st motion-stop command and return resulting status tuple.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
get_home_offset_pulses()[source]

Query go and return home offset in pulses from HO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_home_offset_pulses(...)
set_home_offset_pulses(offset)[source]

Set home offset in pulses with so and require GS00 acknowledgement.

Parameters:

offset (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_pulses(...)
get_jog_step_pulses()[source]

Query gj and return jog step size in pulses from GJ reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_jog_step_pulses(...)
set_jog_step_pulses(step)[source]

Set jog step size in pulses with sj and require GS00.

Parameters:

step (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_pulses(...)
get_velocity_percent()[source]

Query gv and return velocity/power compensation as a percentage.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
set_velocity_percent(percent)[source]

Set velocity/power compensation using sv (0..100 percent).

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)
save_user_data()[source]

Persist current user/motor parameters to non-volatile memory via us.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
change_address(new_address)[source]

Change module address with ca and update local wrapper state.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
get_motor_info(motor_index)[source]

Query i1/i2 and return parsed motor diagnostics/settings.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
set_forward_period(motor_index, period)[source]

Set resonant forward period using f1/f2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_backward_period(motor_index, period)[source]

Set resonant backward period using b1/b2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
optimize_motors(*, timeout=300.0)[source]

Run long optimization cycle via om until non-busy completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
get_position_pulses()

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
class ElliptecBase.elliptec_base.ElliptecClosedLoopTuningMixin[source]

Bases: ElliptecClosedLoopActuatorMixin

Frequency search, current-curve scan, skip, and clean mechanics (not on all iris models).

search_frequency(motor_index, *, timeout=20.0)[source]

Run resonance search for one motor using s1/s2.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
scan_current_curve(motor_index, *, timeout=20.0)[source]

Run current-curve scan (c1/c2) and return C1/C2 packet.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)

Enable startup skip-frequency behavior using the sk command.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
clean_mechanics(*, timeout=300.0)[source]

Run maintenance cleaning cycle via cm until completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
change_address(new_address)

Change module address with ca and update local wrapper state.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
get_home_offset_pulses()

Query go and return home offset in pulses from HO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_home_offset_pulses(...)
get_jog_step_pulses()

Query gj and return jog step size in pulses from GJ reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_jog_step_pulses(...)
get_motor_info(motor_index)

Query i1/i2 and return parsed motor diagnostics/settings.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_position_pulses()

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Query gv and return velocity/power compensation as a percentage.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
home(direction='cw', *, wait=True, timeout=None)

Send ho to move to home; optionally wait and return final pulse position.

Parameters:
  • direction (str) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # home(...)
jog_backward(*, wait=True, timeout=None)

Send bw jog/backward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_backward(...)
jog_forward(*, wait=True, timeout=None)

Send fw jog/forward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_forward(...)
move_absolute_pulses(position, *, wait=True, timeout=None)

Send ma absolute move in pulses; optionally wait for final PO.

Parameters:
  • position (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_absolute_pulses(...)
move_relative_pulses(delta, *, wait=True, timeout=None)

Send mr relative move in pulses; optionally wait for final PO.

Parameters:
  • delta (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_relative_pulses(...)
optimize_motors(*, timeout=300.0)

Run long optimization cycle via om until non-busy completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
save_user_data()

Persist current user/motor parameters to non-volatile memory via us.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
set_backward_period(motor_index, period)

Set resonant backward period using b1/b2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set resonant forward period using f1/f2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_home_offset_pulses(offset)

Set home offset in pulses with so and require GS00 acknowledgement.

Parameters:

offset (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_pulses(...)
set_jog_step_pulses(step)

Set jog step size in pulses with sj and require GS00.

Parameters:

step (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_pulses(...)
set_velocity_percent(percent)

Set velocity/power compensation using sv (0..100 percent).

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)
stop(*, timeout=None)

Send st motion-stop command and return resulting status tuple.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
bus
address
motion_timeout
class ElliptecBase.elliptec_base.ElliptecMillimetreUnitsMixin[source]

Bases: object

pulses_per_unit from IN interpreted as pulses per millimetre.

device_info
pulses_per_mm()[source]

Return pulses-per-millimetre conversion factor from IN info.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # pulses_per_mm(...)
mm_to_pulses(mm)[source]

Convert physical distance in mm to integer pulse units.

Parameters:

mm (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # mm_to_pulses(...)
pulses_to_mm(pulses)[source]

Convert pulse counts to physical distance in mm.

Parameters:

pulses (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # pulses_to_mm(...)
get_position_mm()[source]

Return current position converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_position_mm(...)
move_absolute_mm(mm, *, wait=True, timeout=None)[source]

Move to an absolute millimetre position using pulse conversion helpers.

Parameters:
  • mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_absolute_mm(...)
move_relative_mm(delta_mm, *, wait=True, timeout=None)[source]

Move by a relative millimetre offset using pulse conversion helpers.

Parameters:
  • delta_mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_relative_mm(...)
get_home_offset_mm()[source]

Return home offset converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_home_offset_mm(...)
set_home_offset_mm(mm)[source]

Set home offset from millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_mm(...)
get_jog_step_mm()[source]

Return jog step converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_jog_step_mm(...)
set_jog_step_mm(mm)[source]

Set jog step in millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_mm(...)
class ElliptecBase.elliptec_base.ElliptecDegreeUnitsMixin[source]

Bases: object

pulses_per_unit from IN interpreted as pulses per revolution.

device_info
pulses_per_revolution()[source]

Return pulses-per-revolution conversion factor from IN info.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # pulses_per_revolution(...)
degrees_to_pulses(degrees)[source]

Convert degrees to integer pulse counts for rotary devices.

Parameters:

degrees (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # degrees_to_pulses(...)
pulses_to_degrees(pulses)[source]

Convert pulse counts to degrees for rotary devices.

Parameters:

pulses (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # pulses_to_degrees(...)
get_position_degrees()[source]

Return current position converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_position_degrees(...)
move_absolute_degrees(degrees, *, wait=True, timeout=None)[source]

Move to an absolute angle in degrees using pulse conversion helpers.

Parameters:
  • degrees (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_absolute_degrees(...)
move_relative_degrees(delta_degrees, *, wait=True, timeout=None)[source]

Move by a relative angular offset in degrees.

Parameters:
  • delta_degrees (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_relative_degrees(...)
get_home_offset_degrees()[source]

Return home offset converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_home_offset_degrees(...)
set_home_offset_degrees(degrees)[source]

Set home offset in degrees after conversion to pulses.

Parameters:

degrees (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_degrees(...)
get_jog_step_degrees()[source]

Return jog step converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_jog_step_degrees(...)
set_jog_step_degrees(degrees)[source]

Set jog step in degrees after conversion to pulses.

Parameters:

degrees (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_degrees(...)

Rotary Stages

class ElliptecRotaryStages.rotary_base.ElliptecRotaryMotorPeriods[source]

Bases: object

Optional rotary commands for devices that support per-motor forward/backward period.

Not all Elliptec rotary devices expose f1/b1/f2/b2 in the protocol (for example ELL16 and ELL21 omit these in this library).

bus
address
set_forward_period(motor_index, period)[source]

Set forward period.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_backward_period(motor_index, period)[source]

Set backward period.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
class ElliptecRotaryStages.rotary_base.ElliptecRotaryStage(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecAddressedDeviceBase, ElliptecClosedLoopTuningMixin, ElliptecDegreeUnitsMixin

Shared-bus base for Thorlabs Elliptec closed-loop rotary stages (ELL14 family, etc.).

Subclasses must set MODEL_CODE and MODEL_FAMILY_NAME class attributes.

DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
change_address(new_address)

Change module address with ca and update local wrapper state.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clean_mechanics(*, timeout=300.0)

Run maintenance cleaning cycle via cm until completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
degrees_to_pulses(degrees)

Convert degrees to integer pulse counts for rotary devices.

Parameters:

degrees (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # degrees_to_pulses(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
get_home_offset_degrees()

Return home offset converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_home_offset_degrees(...)
get_home_offset_pulses()

Query go and return home offset in pulses from HO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_home_offset_pulses(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_jog_step_degrees()

Return jog step converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_jog_step_degrees(...)
get_jog_step_pulses()

Query gj and return jog step size in pulses from GJ reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_jog_step_pulses(...)
get_motor_info(motor_index)

Query i1/i2 and return parsed motor diagnostics/settings.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_position_degrees()

Return current position converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_position_degrees(...)
get_position_pulses()

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Query gv and return velocity/power compensation as a percentage.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
home(direction='cw', *, wait=True, timeout=None)

Send ho to move to home; optionally wait and return final pulse position.

Parameters:
  • direction (str) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # home(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
jog_backward(*, wait=True, timeout=None)

Send bw jog/backward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_backward(...)
jog_forward(*, wait=True, timeout=None)

Send fw jog/forward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_forward(...)
move_absolute_degrees(degrees, *, wait=True, timeout=None)

Move to an absolute angle in degrees using pulse conversion helpers.

Parameters:
  • degrees (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_absolute_degrees(...)
move_absolute_pulses(position, *, wait=True, timeout=None)

Send ma absolute move in pulses; optionally wait for final PO.

Parameters:
  • position (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_absolute_pulses(...)
move_relative_degrees(delta_degrees, *, wait=True, timeout=None)

Move by a relative angular offset in degrees.

Parameters:
  • delta_degrees (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_relative_degrees(...)
move_relative_pulses(delta, *, wait=True, timeout=None)

Send mr relative move in pulses; optionally wait for final PO.

Parameters:
  • delta (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_relative_pulses(...)
optimize_motors(*, timeout=300.0)

Run long optimization cycle via om until non-busy completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
pulses_per_revolution()

Return pulses-per-revolution conversion factor from IN info.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # pulses_per_revolution(...)
pulses_to_degrees(pulses)

Convert pulse counts to degrees for rotary devices.

Parameters:

pulses (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # pulses_to_degrees(...)
save_user_data()

Persist current user/motor parameters to non-volatile memory via us.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
scan_current_curve(motor_index, *, timeout=20.0)

Run current-curve scan (c1/c2) and return C1/C2 packet.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
search_frequency(motor_index, *, timeout=20.0)

Run resonance search for one motor using s1/s2.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
set_backward_period(motor_index, period)

Set resonant backward period using b1/b2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set resonant forward period using f1/f2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_home_offset_degrees(degrees)

Set home offset in degrees after conversion to pulses.

Parameters:

degrees (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_degrees(...)
set_home_offset_pulses(offset)

Set home offset in pulses with so and require GS00 acknowledgement.

Parameters:

offset (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_pulses(...)
set_jog_step_degrees(degrees)

Set jog step in degrees after conversion to pulses.

Parameters:

degrees (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_degrees(...)
set_jog_step_pulses(step)

Set jog step size in pulses with sj and require GS00.

Parameters:

step (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_pulses(...)
set_velocity_percent(percent)

Set velocity/power compensation using sv (0..100 percent).

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)

Enable startup skip-frequency behavior using the sk command.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
stop(*, timeout=None)

Send st motion-stop command and return resulting status tuple.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
MODEL_CODE
MODEL_FAMILY_NAME
bus
address
motion_timeout
class ElliptecRotaryStages.ELL14.DeviceInfo(address: 'str', model_code: 'int', serial_number: 'str', year: 'int', firmware_release: 'str', hardware_release: 'int', is_imperial: 'bool', travel: 'int', pulses_per_unit: 'int')[source]

Bases: object

address
model_code
serial_number
year
firmware_release
hardware_release
is_imperial
travel
pulses_per_unit
property model_name

Model name.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # model_name(...)
class ElliptecRotaryStages.ELL14.Ell14(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecRotaryStage, ElliptecRotaryMotorPeriods

Shared-bus wrapper for a Thorlabs Elliptec ELL14 rotary stage.

This wrapper does not own the COM port. It uses an ElliptecBus instance and communicates only through addressed transactions on that shared bus.

MODEL_CODE = 14
MODEL_FAMILY_NAME = 'ELL14'
enable_continuous_mode(*, velocity_percent=50)[source]

ELL14-only convenience helper:.

Parameters:

velocity_percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # enable_continuous_mode(...)
disable_continuous_mode(*, jog_step_pulses=None)[source]

Leave continuous mode by restoring a non-zero jog step.

Parameters:

jog_step_pulses (Optional[int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # disable_continuous_mode(...)
DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
change_address(new_address)

Change module address with ca and update local wrapper state.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clean_mechanics(*, timeout=300.0)

Run maintenance cleaning cycle via cm until completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
degrees_to_pulses(degrees)

Convert degrees to integer pulse counts for rotary devices.

Parameters:

degrees (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # degrees_to_pulses(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
get_home_offset_degrees()

Return home offset converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_home_offset_degrees(...)
get_home_offset_pulses()

Query go and return home offset in pulses from HO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_home_offset_pulses(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_jog_step_degrees()

Return jog step converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_jog_step_degrees(...)
get_jog_step_pulses()

Query gj and return jog step size in pulses from GJ reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_jog_step_pulses(...)
get_motor_info(motor_index)

Query i1/i2 and return parsed motor diagnostics/settings.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_position_degrees()

Return current position converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_position_degrees(...)
get_position_pulses()

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Query gv and return velocity/power compensation as a percentage.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
home(direction='cw', *, wait=True, timeout=None)

Send ho to move to home; optionally wait and return final pulse position.

Parameters:
  • direction (str) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # home(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
jog_backward(*, wait=True, timeout=None)

Send bw jog/backward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_backward(...)
jog_forward(*, wait=True, timeout=None)

Send fw jog/forward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_forward(...)
move_absolute_degrees(degrees, *, wait=True, timeout=None)

Move to an absolute angle in degrees using pulse conversion helpers.

Parameters:
  • degrees (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_absolute_degrees(...)
move_absolute_pulses(position, *, wait=True, timeout=None)

Send ma absolute move in pulses; optionally wait for final PO.

Parameters:
  • position (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_absolute_pulses(...)
move_relative_degrees(delta_degrees, *, wait=True, timeout=None)

Move by a relative angular offset in degrees.

Parameters:
  • delta_degrees (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_relative_degrees(...)
move_relative_pulses(delta, *, wait=True, timeout=None)

Send mr relative move in pulses; optionally wait for final PO.

Parameters:
  • delta (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_relative_pulses(...)
optimize_motors(*, timeout=300.0)

Run long optimization cycle via om until non-busy completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
pulses_per_revolution()

Return pulses-per-revolution conversion factor from IN info.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # pulses_per_revolution(...)
pulses_to_degrees(pulses)

Convert pulse counts to degrees for rotary devices.

Parameters:

pulses (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # pulses_to_degrees(...)
save_user_data()

Persist current user/motor parameters to non-volatile memory via us.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
scan_current_curve(motor_index, *, timeout=20.0)

Run current-curve scan (c1/c2) and return C1/C2 packet.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
search_frequency(motor_index, *, timeout=20.0)

Run resonance search for one motor using s1/s2.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
set_backward_period(motor_index, period)

Set resonant backward period using b1/b2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set resonant forward period using f1/f2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_home_offset_degrees(degrees)

Set home offset in degrees after conversion to pulses.

Parameters:

degrees (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_degrees(...)
set_home_offset_pulses(offset)

Set home offset in pulses with so and require GS00 acknowledgement.

Parameters:

offset (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_pulses(...)
set_jog_step_degrees(degrees)

Set jog step in degrees after conversion to pulses.

Parameters:

degrees (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_degrees(...)
set_jog_step_pulses(step)

Set jog step size in pulses with sj and require GS00.

Parameters:

step (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_pulses(...)
set_velocity_percent(percent)

Set velocity/power compensation using sv (0..100 percent).

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)

Enable startup skip-frequency behavior using the sk command.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
stop(*, timeout=None)

Send st motion-stop command and return resulting status tuple.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
bus
address
motion_timeout
class ElliptecRotaryStages.ELL14.MotorInfo(address: 'str', motor_index: 'int', loop_on: 'bool', motor_ok: 'bool', current_raw: 'int', current_amps: 'float', forward_period: 'int', backward_period: 'int')[source]

Bases: object

address
motor_index
loop_on
motor_ok
current_raw
current_amps
forward_period
backward_period
class ElliptecRotaryStages.ELL16.DeviceInfo(address: 'str', model_code: 'int', serial_number: 'str', year: 'int', firmware_release: 'str', hardware_release: 'int', is_imperial: 'bool', travel: 'int', pulses_per_unit: 'int')[source]

Bases: object

address
model_code
serial_number
year
firmware_release
hardware_release
is_imperial
travel
pulses_per_unit
property model_name

Model name.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # model_name(...)
class ElliptecRotaryStages.ELL16.Ell16(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecRotaryStage

Shared-bus wrapper for a Thorlabs Elliptec ELL16 device.

This wrapper does not own the COM port. It uses an ElliptecBus instance and communicates only through addressed transactions on that shared bus.

MODEL_CODE = 16
MODEL_FAMILY_NAME = 'ELL16'
DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
change_address(new_address)

Change module address with ca and update local wrapper state.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clean_mechanics(*, timeout=300.0)

Run maintenance cleaning cycle via cm until completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
degrees_to_pulses(degrees)

Convert degrees to integer pulse counts for rotary devices.

Parameters:

degrees (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # degrees_to_pulses(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
get_home_offset_degrees()

Return home offset converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_home_offset_degrees(...)
get_home_offset_pulses()

Query go and return home offset in pulses from HO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_home_offset_pulses(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_jog_step_degrees()

Return jog step converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_jog_step_degrees(...)
get_jog_step_pulses()

Query gj and return jog step size in pulses from GJ reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_jog_step_pulses(...)
get_motor_info(motor_index)

Query i1/i2 and return parsed motor diagnostics/settings.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_position_degrees()

Return current position converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_position_degrees(...)
get_position_pulses()

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Query gv and return velocity/power compensation as a percentage.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
home(direction='cw', *, wait=True, timeout=None)

Send ho to move to home; optionally wait and return final pulse position.

Parameters:
  • direction (str) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # home(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
jog_backward(*, wait=True, timeout=None)

Send bw jog/backward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_backward(...)
jog_forward(*, wait=True, timeout=None)

Send fw jog/forward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_forward(...)
move_absolute_degrees(degrees, *, wait=True, timeout=None)

Move to an absolute angle in degrees using pulse conversion helpers.

Parameters:
  • degrees (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_absolute_degrees(...)
move_absolute_pulses(position, *, wait=True, timeout=None)

Send ma absolute move in pulses; optionally wait for final PO.

Parameters:
  • position (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_absolute_pulses(...)
move_relative_degrees(delta_degrees, *, wait=True, timeout=None)

Move by a relative angular offset in degrees.

Parameters:
  • delta_degrees (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_relative_degrees(...)
move_relative_pulses(delta, *, wait=True, timeout=None)

Send mr relative move in pulses; optionally wait for final PO.

Parameters:
  • delta (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_relative_pulses(...)
optimize_motors(*, timeout=300.0)

Run long optimization cycle via om until non-busy completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
pulses_per_revolution()

Return pulses-per-revolution conversion factor from IN info.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # pulses_per_revolution(...)
pulses_to_degrees(pulses)

Convert pulse counts to degrees for rotary devices.

Parameters:

pulses (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # pulses_to_degrees(...)
save_user_data()

Persist current user/motor parameters to non-volatile memory via us.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
scan_current_curve(motor_index, *, timeout=20.0)

Run current-curve scan (c1/c2) and return C1/C2 packet.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
search_frequency(motor_index, *, timeout=20.0)

Run resonance search for one motor using s1/s2.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
set_backward_period(motor_index, period)

Set resonant backward period using b1/b2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set resonant forward period using f1/f2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_home_offset_degrees(degrees)

Set home offset in degrees after conversion to pulses.

Parameters:

degrees (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_degrees(...)
set_home_offset_pulses(offset)

Set home offset in pulses with so and require GS00 acknowledgement.

Parameters:

offset (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_pulses(...)
set_jog_step_degrees(degrees)

Set jog step in degrees after conversion to pulses.

Parameters:

degrees (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_degrees(...)
set_jog_step_pulses(step)

Set jog step size in pulses with sj and require GS00.

Parameters:

step (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_pulses(...)
set_velocity_percent(percent)

Set velocity/power compensation using sv (0..100 percent).

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)

Enable startup skip-frequency behavior using the sk command.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
stop(*, timeout=None)

Send st motion-stop command and return resulting status tuple.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
bus
address
motion_timeout
class ElliptecRotaryStages.ELL16.MotorInfo(address: 'str', motor_index: 'int', loop_on: 'bool', motor_ok: 'bool', current_raw: 'int', current_amps: 'float', forward_period: 'int', backward_period: 'int')[source]

Bases: object

address
motor_index
loop_on
motor_ok
current_raw
current_amps
forward_period
backward_period
class ElliptecRotaryStages.ELL18.DeviceInfo(address: 'str', model_code: 'int', serial_number: 'str', year: 'int', firmware_release: 'str', hardware_release: 'int', is_imperial: 'bool', travel: 'int', pulses_per_unit: 'int')[source]

Bases: object

address
model_code
serial_number
year
firmware_release
hardware_release
is_imperial
travel
pulses_per_unit
property model_name

Model name.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # model_name(...)
class ElliptecRotaryStages.ELL18.Ell18(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecRotaryStage, ElliptecRotaryMotorPeriods

Shared-bus wrapper for a Thorlabs Elliptec ELL18 rotary stage.

This wrapper does not own the COM port. It uses an ElliptecBus instance and communicates only through addressed transactions on that shared bus.

MODEL_CODE = 18
MODEL_FAMILY_NAME = 'ELL18'
DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
change_address(new_address)

Change module address with ca and update local wrapper state.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clean_mechanics(*, timeout=300.0)

Run maintenance cleaning cycle via cm until completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
degrees_to_pulses(degrees)

Convert degrees to integer pulse counts for rotary devices.

Parameters:

degrees (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # degrees_to_pulses(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
get_home_offset_degrees()

Return home offset converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_home_offset_degrees(...)
get_home_offset_pulses()

Query go and return home offset in pulses from HO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_home_offset_pulses(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_jog_step_degrees()

Return jog step converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_jog_step_degrees(...)
get_jog_step_pulses()

Query gj and return jog step size in pulses from GJ reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_jog_step_pulses(...)
get_motor_info(motor_index)

Query i1/i2 and return parsed motor diagnostics/settings.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_position_degrees()

Return current position converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_position_degrees(...)
get_position_pulses()

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Query gv and return velocity/power compensation as a percentage.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
home(direction='cw', *, wait=True, timeout=None)

Send ho to move to home; optionally wait and return final pulse position.

Parameters:
  • direction (str) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # home(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
jog_backward(*, wait=True, timeout=None)

Send bw jog/backward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_backward(...)
jog_forward(*, wait=True, timeout=None)

Send fw jog/forward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_forward(...)
move_absolute_degrees(degrees, *, wait=True, timeout=None)

Move to an absolute angle in degrees using pulse conversion helpers.

Parameters:
  • degrees (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_absolute_degrees(...)
move_absolute_pulses(position, *, wait=True, timeout=None)

Send ma absolute move in pulses; optionally wait for final PO.

Parameters:
  • position (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_absolute_pulses(...)
move_relative_degrees(delta_degrees, *, wait=True, timeout=None)

Move by a relative angular offset in degrees.

Parameters:
  • delta_degrees (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_relative_degrees(...)
move_relative_pulses(delta, *, wait=True, timeout=None)

Send mr relative move in pulses; optionally wait for final PO.

Parameters:
  • delta (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_relative_pulses(...)
optimize_motors(*, timeout=300.0)

Run long optimization cycle via om until non-busy completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
pulses_per_revolution()

Return pulses-per-revolution conversion factor from IN info.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # pulses_per_revolution(...)
pulses_to_degrees(pulses)

Convert pulse counts to degrees for rotary devices.

Parameters:

pulses (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # pulses_to_degrees(...)
save_user_data()

Persist current user/motor parameters to non-volatile memory via us.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
scan_current_curve(motor_index, *, timeout=20.0)

Run current-curve scan (c1/c2) and return C1/C2 packet.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
search_frequency(motor_index, *, timeout=20.0)

Run resonance search for one motor using s1/s2.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
set_backward_period(motor_index, period)

Set resonant backward period using b1/b2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set resonant forward period using f1/f2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_home_offset_degrees(degrees)

Set home offset in degrees after conversion to pulses.

Parameters:

degrees (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_degrees(...)
set_home_offset_pulses(offset)

Set home offset in pulses with so and require GS00 acknowledgement.

Parameters:

offset (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_pulses(...)
set_jog_step_degrees(degrees)

Set jog step in degrees after conversion to pulses.

Parameters:

degrees (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_degrees(...)
set_jog_step_pulses(step)

Set jog step size in pulses with sj and require GS00.

Parameters:

step (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_pulses(...)
set_velocity_percent(percent)

Set velocity/power compensation using sv (0..100 percent).

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)

Enable startup skip-frequency behavior using the sk command.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
stop(*, timeout=None)

Send st motion-stop command and return resulting status tuple.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
bus
address
motion_timeout
class ElliptecRotaryStages.ELL18.MotorInfo(address: 'str', motor_index: 'int', loop_on: 'bool', motor_ok: 'bool', current_raw: 'int', current_amps: 'float', forward_period: 'int', backward_period: 'int')[source]

Bases: object

address
motor_index
loop_on
motor_ok
current_raw
current_amps
forward_period
backward_period
class ElliptecRotaryStages.ELL21.DeviceInfo(address: 'str', model_code: 'int', serial_number: 'str', year: 'int', firmware_release: 'str', hardware_release: 'int', is_imperial: 'bool', travel: 'int', pulses_per_unit: 'int')[source]

Bases: object

address
model_code
serial_number
year
firmware_release
hardware_release
is_imperial
travel
pulses_per_unit
property model_name

Model name.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # model_name(...)
class ElliptecRotaryStages.ELL21.Ell21(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecRotaryStage

Shared-bus wrapper for a Thorlabs Elliptec ELL21 rotary stage.

This wrapper does not own the COM port. It uses an ElliptecBus instance and communicates only through addressed transactions on that shared bus.

Important ELL21-specific note:

  • f1, b1, f2, b2 are intentionally omitted because the protocol marks them as not applicable to ELL21.

MODEL_CODE = 21
MODEL_FAMILY_NAME = 'ELL21'
DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
change_address(new_address)

Change module address with ca and update local wrapper state.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clean_mechanics(*, timeout=300.0)

Run maintenance cleaning cycle via cm until completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
degrees_to_pulses(degrees)

Convert degrees to integer pulse counts for rotary devices.

Parameters:

degrees (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # degrees_to_pulses(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
get_home_offset_degrees()

Return home offset converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_home_offset_degrees(...)
get_home_offset_pulses()

Query go and return home offset in pulses from HO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_home_offset_pulses(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_jog_step_degrees()

Return jog step converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_jog_step_degrees(...)
get_jog_step_pulses()

Query gj and return jog step size in pulses from GJ reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_jog_step_pulses(...)
get_motor_info(motor_index)

Query i1/i2 and return parsed motor diagnostics/settings.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_position_degrees()

Return current position converted from pulses to degrees.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_position_degrees(...)
get_position_pulses()

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Query gv and return velocity/power compensation as a percentage.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
home(direction='cw', *, wait=True, timeout=None)

Send ho to move to home; optionally wait and return final pulse position.

Parameters:
  • direction (str) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # home(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
jog_backward(*, wait=True, timeout=None)

Send bw jog/backward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_backward(...)
jog_forward(*, wait=True, timeout=None)

Send fw jog/forward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_forward(...)
move_absolute_degrees(degrees, *, wait=True, timeout=None)

Move to an absolute angle in degrees using pulse conversion helpers.

Parameters:
  • degrees (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_absolute_degrees(...)
move_absolute_pulses(position, *, wait=True, timeout=None)

Send ma absolute move in pulses; optionally wait for final PO.

Parameters:
  • position (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_absolute_pulses(...)
move_relative_degrees(delta_degrees, *, wait=True, timeout=None)

Move by a relative angular offset in degrees.

Parameters:
  • delta_degrees (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_relative_degrees(...)
move_relative_pulses(delta, *, wait=True, timeout=None)

Send mr relative move in pulses; optionally wait for final PO.

Parameters:
  • delta (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_relative_pulses(...)
optimize_motors(*, timeout=300.0)

Run long optimization cycle via om until non-busy completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
pulses_per_revolution()

Return pulses-per-revolution conversion factor from IN info.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # pulses_per_revolution(...)
pulses_to_degrees(pulses)

Convert pulse counts to degrees for rotary devices.

Parameters:

pulses (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # pulses_to_degrees(...)
save_user_data()

Persist current user/motor parameters to non-volatile memory via us.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
scan_current_curve(motor_index, *, timeout=20.0)

Run current-curve scan (c1/c2) and return C1/C2 packet.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
search_frequency(motor_index, *, timeout=20.0)

Run resonance search for one motor using s1/s2.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
set_backward_period(motor_index, period)

Set resonant backward period using b1/b2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set resonant forward period using f1/f2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_home_offset_degrees(degrees)

Set home offset in degrees after conversion to pulses.

Parameters:

degrees (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_degrees(...)
set_home_offset_pulses(offset)

Set home offset in pulses with so and require GS00 acknowledgement.

Parameters:

offset (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_pulses(...)
set_jog_step_degrees(degrees)

Set jog step in degrees after conversion to pulses.

Parameters:

degrees (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_degrees(...)
set_jog_step_pulses(step)

Set jog step size in pulses with sj and require GS00.

Parameters:

step (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_pulses(...)
set_velocity_percent(percent)

Set velocity/power compensation using sv (0..100 percent).

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)

Enable startup skip-frequency behavior using the sk command.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
stop(*, timeout=None)

Send st motion-stop command and return resulting status tuple.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
bus
address
motion_timeout
class ElliptecRotaryStages.ELL21.MotorInfo(address: 'str', motor_index: 'int', loop_on: 'bool', motor_ok: 'bool', current_raw: 'int', current_amps: 'float', forward_period: 'int', backward_period: 'int')[source]

Bases: object

address
motor_index
loop_on
motor_ok
current_raw
current_amps
forward_period
backward_period

Linear Stages

class ElliptecLinearStages.linear_base.ElliptecLinearStage(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecAddressedDeviceBase, ElliptecClosedLoopTuningMixin, ElliptecMillimetreUnitsMixin

Shared-bus base for Thorlabs Elliptec closed-loop linear stages (ELL17, ELL20, …).

Subclasses must set MODEL_CODE and MODEL_FAMILY_NAME class attributes.

DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
change_address(new_address)

Change module address with ca and update local wrapper state.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clean_mechanics(*, timeout=300.0)

Run maintenance cleaning cycle via cm until completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
get_home_offset_mm()

Return home offset converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_home_offset_mm(...)
get_home_offset_pulses()

Query go and return home offset in pulses from HO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_home_offset_pulses(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_jog_step_mm()

Return jog step converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_jog_step_mm(...)
get_jog_step_pulses()

Query gj and return jog step size in pulses from GJ reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_jog_step_pulses(...)
get_motor_info(motor_index)

Query i1/i2 and return parsed motor diagnostics/settings.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_position_mm()

Return current position converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_position_mm(...)
get_position_pulses()

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Query gv and return velocity/power compensation as a percentage.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
home(direction='cw', *, wait=True, timeout=None)

Send ho to move to home; optionally wait and return final pulse position.

Parameters:
  • direction (str) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # home(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
jog_backward(*, wait=True, timeout=None)

Send bw jog/backward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_backward(...)
jog_forward(*, wait=True, timeout=None)

Send fw jog/forward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_forward(...)
mm_to_pulses(mm)

Convert physical distance in mm to integer pulse units.

Parameters:

mm (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # mm_to_pulses(...)
move_absolute_mm(mm, *, wait=True, timeout=None)

Move to an absolute millimetre position using pulse conversion helpers.

Parameters:
  • mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_absolute_mm(...)
move_absolute_pulses(position, *, wait=True, timeout=None)

Send ma absolute move in pulses; optionally wait for final PO.

Parameters:
  • position (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_absolute_pulses(...)
move_relative_mm(delta_mm, *, wait=True, timeout=None)

Move by a relative millimetre offset using pulse conversion helpers.

Parameters:
  • delta_mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_relative_mm(...)
move_relative_pulses(delta, *, wait=True, timeout=None)

Send mr relative move in pulses; optionally wait for final PO.

Parameters:
  • delta (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_relative_pulses(...)
optimize_motors(*, timeout=300.0)

Run long optimization cycle via om until non-busy completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
pulses_per_mm()

Return pulses-per-millimetre conversion factor from IN info.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # pulses_per_mm(...)
pulses_to_mm(pulses)

Convert pulse counts to physical distance in mm.

Parameters:

pulses (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # pulses_to_mm(...)
save_user_data()

Persist current user/motor parameters to non-volatile memory via us.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
scan_current_curve(motor_index, *, timeout=20.0)

Run current-curve scan (c1/c2) and return C1/C2 packet.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
search_frequency(motor_index, *, timeout=20.0)

Run resonance search for one motor using s1/s2.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
set_backward_period(motor_index, period)

Set resonant backward period using b1/b2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set resonant forward period using f1/f2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_home_offset_mm(mm)

Set home offset from millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_mm(...)
set_home_offset_pulses(offset)

Set home offset in pulses with so and require GS00 acknowledgement.

Parameters:

offset (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_pulses(...)
set_jog_step_mm(mm)

Set jog step in millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_mm(...)
set_jog_step_pulses(step)

Set jog step size in pulses with sj and require GS00.

Parameters:

step (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_pulses(...)
set_velocity_percent(percent)

Set velocity/power compensation using sv (0..100 percent).

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)

Enable startup skip-frequency behavior using the sk command.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
stop(*, timeout=None)

Send st motion-stop command and return resulting status tuple.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
MODEL_CODE
MODEL_FAMILY_NAME
bus
address
motion_timeout
class ElliptecLinearStages.ELL17.DeviceInfo(address: 'str', model_code: 'int', serial_number: 'str', year: 'int', firmware_release: 'str', hardware_release: 'int', is_imperial: 'bool', travel: 'int', pulses_per_unit: 'int')[source]

Bases: object

address
model_code
serial_number
year
firmware_release
hardware_release
is_imperial
travel
pulses_per_unit
property model_name

Model name.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # model_name(...)
class ElliptecLinearStages.ELL17.Ell17(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecLinearStage

Shared-bus wrapper for a Thorlabs Elliptec ELL17 linear stage.

This wrapper does not own the COM port. It uses an ElliptecBus instance and communicates only through addressed transactions on that shared bus.

MODEL_CODE = 17
MODEL_FAMILY_NAME = 'ELL17'
DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
change_address(new_address)

Change module address with ca and update local wrapper state.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clean_mechanics(*, timeout=300.0)

Run maintenance cleaning cycle via cm until completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
get_home_offset_mm()

Return home offset converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_home_offset_mm(...)
get_home_offset_pulses()

Query go and return home offset in pulses from HO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_home_offset_pulses(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_jog_step_mm()

Return jog step converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_jog_step_mm(...)
get_jog_step_pulses()

Query gj and return jog step size in pulses from GJ reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_jog_step_pulses(...)
get_motor_info(motor_index)

Query i1/i2 and return parsed motor diagnostics/settings.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_position_mm()

Return current position converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_position_mm(...)
get_position_pulses()

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Query gv and return velocity/power compensation as a percentage.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
home(direction='cw', *, wait=True, timeout=None)

Send ho to move to home; optionally wait and return final pulse position.

Parameters:
  • direction (str) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # home(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
jog_backward(*, wait=True, timeout=None)

Send bw jog/backward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_backward(...)
jog_forward(*, wait=True, timeout=None)

Send fw jog/forward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_forward(...)
mm_to_pulses(mm)

Convert physical distance in mm to integer pulse units.

Parameters:

mm (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # mm_to_pulses(...)
move_absolute_mm(mm, *, wait=True, timeout=None)

Move to an absolute millimetre position using pulse conversion helpers.

Parameters:
  • mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_absolute_mm(...)
move_absolute_pulses(position, *, wait=True, timeout=None)

Send ma absolute move in pulses; optionally wait for final PO.

Parameters:
  • position (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_absolute_pulses(...)
move_relative_mm(delta_mm, *, wait=True, timeout=None)

Move by a relative millimetre offset using pulse conversion helpers.

Parameters:
  • delta_mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_relative_mm(...)
move_relative_pulses(delta, *, wait=True, timeout=None)

Send mr relative move in pulses; optionally wait for final PO.

Parameters:
  • delta (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_relative_pulses(...)
optimize_motors(*, timeout=300.0)

Run long optimization cycle via om until non-busy completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
pulses_per_mm()

Return pulses-per-millimetre conversion factor from IN info.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # pulses_per_mm(...)
pulses_to_mm(pulses)

Convert pulse counts to physical distance in mm.

Parameters:

pulses (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # pulses_to_mm(...)
save_user_data()

Persist current user/motor parameters to non-volatile memory via us.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
scan_current_curve(motor_index, *, timeout=20.0)

Run current-curve scan (c1/c2) and return C1/C2 packet.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
search_frequency(motor_index, *, timeout=20.0)

Run resonance search for one motor using s1/s2.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
set_backward_period(motor_index, period)

Set resonant backward period using b1/b2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set resonant forward period using f1/f2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_home_offset_mm(mm)

Set home offset from millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_mm(...)
set_home_offset_pulses(offset)

Set home offset in pulses with so and require GS00 acknowledgement.

Parameters:

offset (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_pulses(...)
set_jog_step_mm(mm)

Set jog step in millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_mm(...)
set_jog_step_pulses(step)

Set jog step size in pulses with sj and require GS00.

Parameters:

step (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_pulses(...)
set_velocity_percent(percent)

Set velocity/power compensation using sv (0..100 percent).

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)

Enable startup skip-frequency behavior using the sk command.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
stop(*, timeout=None)

Send st motion-stop command and return resulting status tuple.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
bus
address
motion_timeout
class ElliptecLinearStages.ELL17.MotorInfo(address: 'str', motor_index: 'int', loop_on: 'bool', motor_ok: 'bool', current_raw: 'int', current_amps: 'float', forward_period: 'int', backward_period: 'int')[source]

Bases: object

address
motor_index
loop_on
motor_ok
current_raw
current_amps
forward_period
backward_period
class ElliptecLinearStages.ELL20.DeviceInfo(address: 'str', model_code: 'int', serial_number: 'str', year: 'int', firmware_release: 'str', hardware_release: 'int', is_imperial: 'bool', travel: 'int', pulses_per_unit: 'int')[source]

Bases: object

address
model_code
serial_number
year
firmware_release
hardware_release
is_imperial
travel
pulses_per_unit
property model_name

Model name.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # model_name(...)
class ElliptecLinearStages.ELL20.Ell20(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecLinearStage

Shared-bus wrapper for a Thorlabs Elliptec ELL20 linear stage.

This wrapper does not own the COM port. It uses an ElliptecBus instance and communicates only through addressed transactions on that shared bus.

MODEL_CODE = 20
MODEL_FAMILY_NAME = 'ELL20'
DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
change_address(new_address)

Change module address with ca and update local wrapper state.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clean_mechanics(*, timeout=300.0)

Run maintenance cleaning cycle via cm until completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
get_home_offset_mm()

Return home offset converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_home_offset_mm(...)
get_home_offset_pulses()

Query go and return home offset in pulses from HO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_home_offset_pulses(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_jog_step_mm()

Return jog step converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_jog_step_mm(...)
get_jog_step_pulses()

Query gj and return jog step size in pulses from GJ reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_jog_step_pulses(...)
get_motor_info(motor_index)

Query i1/i2 and return parsed motor diagnostics/settings.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_position_mm()

Return current position converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_position_mm(...)
get_position_pulses()

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Query gv and return velocity/power compensation as a percentage.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
home(direction='cw', *, wait=True, timeout=None)

Send ho to move to home; optionally wait and return final pulse position.

Parameters:
  • direction (str) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # home(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
jog_backward(*, wait=True, timeout=None)

Send bw jog/backward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_backward(...)
jog_forward(*, wait=True, timeout=None)

Send fw jog/forward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_forward(...)
mm_to_pulses(mm)

Convert physical distance in mm to integer pulse units.

Parameters:

mm (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # mm_to_pulses(...)
move_absolute_mm(mm, *, wait=True, timeout=None)

Move to an absolute millimetre position using pulse conversion helpers.

Parameters:
  • mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_absolute_mm(...)
move_absolute_pulses(position, *, wait=True, timeout=None)

Send ma absolute move in pulses; optionally wait for final PO.

Parameters:
  • position (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_absolute_pulses(...)
move_relative_mm(delta_mm, *, wait=True, timeout=None)

Move by a relative millimetre offset using pulse conversion helpers.

Parameters:
  • delta_mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_relative_mm(...)
move_relative_pulses(delta, *, wait=True, timeout=None)

Send mr relative move in pulses; optionally wait for final PO.

Parameters:
  • delta (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_relative_pulses(...)
optimize_motors(*, timeout=300.0)

Run long optimization cycle via om until non-busy completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
pulses_per_mm()

Return pulses-per-millimetre conversion factor from IN info.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # pulses_per_mm(...)
pulses_to_mm(pulses)

Convert pulse counts to physical distance in mm.

Parameters:

pulses (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # pulses_to_mm(...)
save_user_data()

Persist current user/motor parameters to non-volatile memory via us.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
scan_current_curve(motor_index, *, timeout=20.0)

Run current-curve scan (c1/c2) and return C1/C2 packet.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
search_frequency(motor_index, *, timeout=20.0)

Run resonance search for one motor using s1/s2.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
set_backward_period(motor_index, period)

Set resonant backward period using b1/b2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set resonant forward period using f1/f2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_home_offset_mm(mm)

Set home offset from millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_mm(...)
set_home_offset_pulses(offset)

Set home offset in pulses with so and require GS00 acknowledgement.

Parameters:

offset (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_pulses(...)
set_jog_step_mm(mm)

Set jog step in millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_mm(...)
set_jog_step_pulses(step)

Set jog step size in pulses with sj and require GS00.

Parameters:

step (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_pulses(...)
set_velocity_percent(percent)

Set velocity/power compensation using sv (0..100 percent).

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)

Enable startup skip-frequency behavior using the sk command.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
stop(*, timeout=None)

Send st motion-stop command and return resulting status tuple.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
bus
address
motion_timeout
class ElliptecLinearStages.ELL20.MotorInfo(address: 'str', motor_index: 'int', loop_on: 'bool', motor_ok: 'bool', current_raw: 'int', current_amps: 'float', forward_period: 'int', backward_period: 'int')[source]

Bases: object

address
motor_index
loop_on
motor_ok
current_raw
current_amps
forward_period
backward_period

Multi-Position Sliders

class ElliptecMultiPositionSlider.slider_base.ElliptecSliderBase(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecAddressedDeviceBase, ElliptecGsQueriesMixin

Shared-bus base for Thorlabs Elliptec multi-position sliders (ELL6 family, ELL9, ELL12, …).

Subclasses must set MODEL_CODE, MODEL_FAMILY_NAME, and MOTORS (indices supported by iN / sN / cN on that hardware).

MOTORS = (1, 2)
forward(*, wait=True, timeout=None)[source]

Forward.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[Packet]

Example

>>> # Example
>>> # forward(...)
backward(*, wait=True, timeout=None)[source]

Backward.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[Packet]

Example

>>> # Example
>>> # backward(...)
stop(*, timeout=None)[source]

Stop.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
get_velocity_percent()[source]

Get velocity percent.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
set_velocity_percent(percent)[source]

Set velocity percent.

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)
save_user_data()[source]

Save user data.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)

Skip frequency search.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
change_address(new_address)[source]

Change address.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
get_motor_info(motor_index)[source]

Get motor info.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
set_forward_period(motor_index, period)[source]

Set forward period.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_backward_period(motor_index, period)[source]

Set backward period.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
search_frequency(motor_index, *, timeout=20.0)[source]

Search frequency.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
scan_current_curve(motor_index, *, timeout=20.0)[source]

Scan current curve.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
optimize_motors(*, timeout=300.0)[source]

Optimize motors.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
clean_mechanics(*, timeout=300.0)[source]

Clean mechanics.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
read_button_event(*, timeout=None)[source]

Read button event.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # read_button_event(...)
DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
MODEL_CODE
MODEL_FAMILY_NAME
bus
address
class ElliptecMultiPositionSlider.ELL6.DeviceInfo(address: 'str', model_code: 'int', serial_number: 'str', year: 'int', firmware_release: 'str', hardware_release: 'int', is_imperial: 'bool', travel: 'int', pulses_per_unit: 'int')[source]

Bases: object

address
model_code
serial_number
year
firmware_release
hardware_release
is_imperial
travel
pulses_per_unit
property model_name

Model name.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # model_name(...)
class ElliptecMultiPositionSlider.ELL6.Ell6(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecSliderBase

Shared-bus wrapper for a Thorlabs Elliptec ELL6 multi-position slider.

This wrapper does not own the COM port. It uses an ElliptecBus instance and communicates only through addressed transactions on that shared bus.

ELL6 is a single-motor slider, so only motor-1-specific commands are exposed.

MODEL_CODE = 6
MODEL_FAMILY_NAME = 'ELL6'
MOTORS = (1,)
get_motor_info()[source]

Get motor info.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
set_forward_period(period)[source]

Set forward period.

Parameters:

period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_backward_period(period)[source]

Set backward period.

Parameters:

period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
search_frequency(*, timeout=20.0)[source]

Search frequency.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
scan_current_curve(*, timeout=20.0)[source]

Scan current curve.

Parameters:

timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
backward(*, wait=True, timeout=None)

Backward.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[Packet]

Example

>>> # Example
>>> # backward(...)
change_address(new_address)

Change address.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clean_mechanics(*, timeout=300.0)

Clean mechanics.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
forward(*, wait=True, timeout=None)

Forward.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[Packet]

Example

>>> # Example
>>> # forward(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Get velocity percent.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
optimize_motors(*, timeout=300.0)

Optimize motors.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
read_button_event(*, timeout=None)

Read button event.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # read_button_event(...)
save_user_data()

Save user data.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
set_velocity_percent(percent)

Set velocity percent.

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)

Skip frequency search.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
stop(*, timeout=None)

Stop.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
bus
address
class ElliptecMultiPositionSlider.ELL6.MotorInfo(address: 'str', motor_index: 'int', loop_on: 'bool', motor_ok: 'bool', current_raw: 'int', current_amps: 'float', forward_period: 'int', backward_period: 'int')[source]

Bases: object

address
motor_index
loop_on
motor_ok
current_raw
current_amps
forward_period
backward_period
class ElliptecMultiPositionSlider.ELL6B.DeviceInfo(address: 'str', model_code: 'int', serial_number: 'str', year: 'int', firmware_release: 'str', hardware_release: 'int', is_imperial: 'bool', travel: 'int', pulses_per_unit: 'int')[source]

Bases: object

address
model_code
serial_number
year
firmware_release
hardware_release
is_imperial
travel
pulses_per_unit
property model_name

Model name.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # model_name(...)
class ElliptecMultiPositionSlider.ELL6B.Ell6B(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecSliderBase

Shared-bus wrapper for a Thorlabs Elliptec ELL6B multi-position slider.

This wrapper does not own the COM port. It uses an ElliptecBus instance and communicates only through addressed transactions on that shared bus.

It intentionally excludes continuous-position commands that do not apply to multi-position slider devices.

MODEL_CODE = 6
MODEL_FAMILY_NAME = 'ELL6B'
DEFAULT_MOTION_TIMEOUT = 30.0
MOTORS = (1, 2)
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
backward(*, wait=True, timeout=None)

Backward.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[Packet]

Example

>>> # Example
>>> # backward(...)
change_address(new_address)

Change address.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clean_mechanics(*, timeout=300.0)

Clean mechanics.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
forward(*, wait=True, timeout=None)

Forward.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[Packet]

Example

>>> # Example
>>> # forward(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_motor_info(motor_index)

Get motor info.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Get velocity percent.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
optimize_motors(*, timeout=300.0)

Optimize motors.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
read_button_event(*, timeout=None)

Read button event.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # read_button_event(...)
save_user_data()

Save user data.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
scan_current_curve(motor_index, *, timeout=20.0)

Scan current curve.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
search_frequency(motor_index, *, timeout=20.0)

Search frequency.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
set_backward_period(motor_index, period)

Set backward period.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set forward period.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_velocity_percent(percent)

Set velocity percent.

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)

Skip frequency search.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
stop(*, timeout=None)

Stop.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
bus
address
class ElliptecMultiPositionSlider.ELL6B.MotorInfo(address: 'str', motor_index: 'int', loop_on: 'bool', motor_ok: 'bool', current_raw: 'int', current_amps: 'float', forward_period: 'int', backward_period: 'int')[source]

Bases: object

address
motor_index
loop_on
motor_ok
current_raw
current_amps
forward_period
backward_period
class ElliptecMultiPositionSlider.ELL9.DeviceInfo(address: 'str', model_code: 'int', serial_number: 'str', year: 'int', firmware_release: 'str', hardware_release: 'int', is_imperial: 'bool', travel: 'int', pulses_per_unit: 'int')[source]

Bases: object

address
model_code
serial_number
year
firmware_release
hardware_release
is_imperial
travel
pulses_per_unit
property model_name

Model name.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # model_name(...)
class ElliptecMultiPositionSlider.ELL9.Ell9(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecSliderBase

Shared-bus wrapper for a Thorlabs Elliptec ELL9 multi-position slider.

This wrapper does not own the COM port. It uses an ElliptecBus instance and communicates only through addressed transactions on that shared bus.

It intentionally excludes continuous-position commands that do not apply to multi-position slider devices.

MODEL_CODE = 9
MODEL_FAMILY_NAME = 'ELL9'
DEFAULT_MOTION_TIMEOUT = 30.0
MOTORS = (1, 2)
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
backward(*, wait=True, timeout=None)

Backward.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[Packet]

Example

>>> # Example
>>> # backward(...)
change_address(new_address)

Change address.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clean_mechanics(*, timeout=300.0)

Clean mechanics.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
forward(*, wait=True, timeout=None)

Forward.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[Packet]

Example

>>> # Example
>>> # forward(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_motor_info(motor_index)

Get motor info.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Get velocity percent.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
optimize_motors(*, timeout=300.0)

Optimize motors.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
read_button_event(*, timeout=None)

Read button event.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # read_button_event(...)
save_user_data()

Save user data.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
scan_current_curve(motor_index, *, timeout=20.0)

Scan current curve.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
search_frequency(motor_index, *, timeout=20.0)

Search frequency.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
set_backward_period(motor_index, period)

Set backward period.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set forward period.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_velocity_percent(percent)

Set velocity percent.

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)

Skip frequency search.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
stop(*, timeout=None)

Stop.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
bus
address
class ElliptecMultiPositionSlider.ELL9.MotorInfo(address: 'str', motor_index: 'int', loop_on: 'bool', motor_ok: 'bool', current_raw: 'int', current_amps: 'float', forward_period: 'int', backward_period: 'int')[source]

Bases: object

address
motor_index
loop_on
motor_ok
current_raw
current_amps
forward_period
backward_period
class ElliptecMultiPositionSlider.ELL12.DeviceInfo(address: 'str', model_code: 'int', serial_number: 'str', year: 'int', firmware_release: 'str', hardware_release: 'int', is_imperial: 'bool', travel: 'int', pulses_per_unit: 'int')[source]

Bases: object

address
model_code
serial_number
year
firmware_release
hardware_release
is_imperial
travel
pulses_per_unit
property model_name

Model name.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # model_name(...)
class ElliptecMultiPositionSlider.ELL12.Ell12(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecSliderBase

Shared-bus wrapper for a Thorlabs Elliptec ELL12 multi-position slider.

This wrapper does not own the COM port. It uses an ElliptecBus instance and communicates only through addressed transactions on that shared bus.

It intentionally excludes continuous-position commands that do not apply to multi-position slider devices.

MODEL_CODE = 12
MODEL_FAMILY_NAME = 'ELL12'
DEFAULT_MOTION_TIMEOUT = 30.0
MOTORS = (1, 2)
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
backward(*, wait=True, timeout=None)

Backward.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[Packet]

Example

>>> # Example
>>> # backward(...)
change_address(new_address)

Change address.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clean_mechanics(*, timeout=300.0)

Clean mechanics.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
forward(*, wait=True, timeout=None)

Forward.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[Packet]

Example

>>> # Example
>>> # forward(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_motor_info(motor_index)

Get motor info.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Get velocity percent.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
optimize_motors(*, timeout=300.0)

Optimize motors.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
read_button_event(*, timeout=None)

Read button event.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # read_button_event(...)
save_user_data()

Save user data.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
scan_current_curve(motor_index, *, timeout=20.0)

Scan current curve.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
search_frequency(motor_index, *, timeout=20.0)

Search frequency.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
set_backward_period(motor_index, period)

Set backward period.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set forward period.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_velocity_percent(percent)

Set velocity percent.

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)

Skip frequency search.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
stop(*, timeout=None)

Stop.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
bus
address
class ElliptecMultiPositionSlider.ELL12.MotorInfo(address: 'str', motor_index: 'int', loop_on: 'bool', motor_ok: 'bool', current_raw: 'int', current_amps: 'float', forward_period: 'int', backward_period: 'int')[source]

Bases: object

address
motor_index
loop_on
motor_ok
current_raw
current_amps
forward_period
backward_period

Iris Modules

class ElliptecMotorized_IRIS.iris_base.ElliptecIrisBase(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecAddressedDeviceBase, ElliptecClosedLoopActuatorMixin, ElliptecMillimetreUnitsMixin

Shared-bus base for Thorlabs Elliptec motorized iris devices (ELL15, ELL15Z, …).

Uses the same closed-loop mm / pulse motion model as linear stages. Some iris models omit certain maintenance / tuning commands; those live on ElliptecIrisExtendedBase.

Subclasses must set MODEL_CODE and MODEL_FAMILY_NAME class attributes.

get_iris_value_mm()[source]

Get iris value mm.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_iris_value_mm(...)
DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
change_address(new_address)

Change module address with ca and update local wrapper state.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
get_home_offset_mm()

Return home offset converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_home_offset_mm(...)
get_home_offset_pulses()

Query go and return home offset in pulses from HO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_home_offset_pulses(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_jog_step_mm()

Return jog step converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_jog_step_mm(...)
get_jog_step_pulses()

Query gj and return jog step size in pulses from GJ reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_jog_step_pulses(...)
get_motor_info(motor_index)

Query i1/i2 and return parsed motor diagnostics/settings.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_position_mm()

Return current position converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_position_mm(...)
get_position_pulses()

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Query gv and return velocity/power compensation as a percentage.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
home(direction='cw', *, wait=True, timeout=None)

Send ho to move to home; optionally wait and return final pulse position.

Parameters:
  • direction (str) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # home(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
jog_backward(*, wait=True, timeout=None)

Send bw jog/backward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_backward(...)
jog_forward(*, wait=True, timeout=None)

Send fw jog/forward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_forward(...)
mm_to_pulses(mm)

Convert physical distance in mm to integer pulse units.

Parameters:

mm (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # mm_to_pulses(...)
move_absolute_mm(mm, *, wait=True, timeout=None)

Move to an absolute millimetre position using pulse conversion helpers.

Parameters:
  • mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_absolute_mm(...)
move_absolute_pulses(position, *, wait=True, timeout=None)

Send ma absolute move in pulses; optionally wait for final PO.

Parameters:
  • position (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_absolute_pulses(...)
move_relative_mm(delta_mm, *, wait=True, timeout=None)

Move by a relative millimetre offset using pulse conversion helpers.

Parameters:
  • delta_mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_relative_mm(...)
move_relative_pulses(delta, *, wait=True, timeout=None)

Send mr relative move in pulses; optionally wait for final PO.

Parameters:
  • delta (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_relative_pulses(...)
optimize_motors(*, timeout=300.0)

Run long optimization cycle via om until non-busy completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
pulses_per_mm()

Return pulses-per-millimetre conversion factor from IN info.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # pulses_per_mm(...)
pulses_to_mm(pulses)

Convert pulse counts to physical distance in mm.

Parameters:

pulses (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # pulses_to_mm(...)
save_user_data()

Persist current user/motor parameters to non-volatile memory via us.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
set_backward_period(motor_index, period)

Set resonant backward period using b1/b2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set resonant forward period using f1/f2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_home_offset_mm(mm)

Set home offset from millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_mm(...)
set_home_offset_pulses(offset)

Set home offset in pulses with so and require GS00 acknowledgement.

Parameters:

offset (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_pulses(...)
set_jog_step_mm(mm)

Set jog step in millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_mm(...)
set_jog_step_pulses(step)

Set jog step size in pulses with sj and require GS00.

Parameters:

step (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_pulses(...)
set_velocity_percent(percent)

Set velocity/power compensation using sv (0..100 percent).

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)
stop(*, timeout=None)

Send st motion-stop command and return resulting status tuple.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
MODEL_CODE
MODEL_FAMILY_NAME
bus
address
motion_timeout
class ElliptecMotorized_IRIS.iris_base.ElliptecIrisExtendedBase(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecAddressedDeviceBase, ElliptecClosedLoopTuningMixin, ElliptecMillimetreUnitsMixin

Iris devices that also expose frequency search, current-curve scan, skip, and clean mechanics.

get_iris_value_mm()[source]

Get iris value mm.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_iris_value_mm(...)
DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
change_address(new_address)

Change module address with ca and update local wrapper state.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clean_mechanics(*, timeout=300.0)

Run maintenance cleaning cycle via cm until completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
get_home_offset_mm()

Return home offset converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_home_offset_mm(...)
get_home_offset_pulses()

Query go and return home offset in pulses from HO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_home_offset_pulses(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_jog_step_mm()

Return jog step converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_jog_step_mm(...)
get_jog_step_pulses()

Query gj and return jog step size in pulses from GJ reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_jog_step_pulses(...)
get_motor_info(motor_index)

Query i1/i2 and return parsed motor diagnostics/settings.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_position_mm()

Return current position converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_position_mm(...)
get_position_pulses()

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Query gv and return velocity/power compensation as a percentage.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
home(direction='cw', *, wait=True, timeout=None)

Send ho to move to home; optionally wait and return final pulse position.

Parameters:
  • direction (str) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # home(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
jog_backward(*, wait=True, timeout=None)

Send bw jog/backward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_backward(...)
jog_forward(*, wait=True, timeout=None)

Send fw jog/forward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_forward(...)
mm_to_pulses(mm)

Convert physical distance in mm to integer pulse units.

Parameters:

mm (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # mm_to_pulses(...)
move_absolute_mm(mm, *, wait=True, timeout=None)

Move to an absolute millimetre position using pulse conversion helpers.

Parameters:
  • mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_absolute_mm(...)
move_absolute_pulses(position, *, wait=True, timeout=None)

Send ma absolute move in pulses; optionally wait for final PO.

Parameters:
  • position (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_absolute_pulses(...)
move_relative_mm(delta_mm, *, wait=True, timeout=None)

Move by a relative millimetre offset using pulse conversion helpers.

Parameters:
  • delta_mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_relative_mm(...)
move_relative_pulses(delta, *, wait=True, timeout=None)

Send mr relative move in pulses; optionally wait for final PO.

Parameters:
  • delta (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_relative_pulses(...)
optimize_motors(*, timeout=300.0)

Run long optimization cycle via om until non-busy completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
pulses_per_mm()

Return pulses-per-millimetre conversion factor from IN info.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # pulses_per_mm(...)
pulses_to_mm(pulses)

Convert pulse counts to physical distance in mm.

Parameters:

pulses (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # pulses_to_mm(...)
save_user_data()

Persist current user/motor parameters to non-volatile memory via us.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
scan_current_curve(motor_index, *, timeout=20.0)

Run current-curve scan (c1/c2) and return C1/C2 packet.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
search_frequency(motor_index, *, timeout=20.0)

Run resonance search for one motor using s1/s2.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
set_backward_period(motor_index, period)

Set resonant backward period using b1/b2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set resonant forward period using f1/f2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_home_offset_mm(mm)

Set home offset from millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_mm(...)
set_home_offset_pulses(offset)

Set home offset in pulses with so and require GS00 acknowledgement.

Parameters:

offset (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_pulses(...)
set_jog_step_mm(mm)

Set jog step in millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_mm(...)
set_jog_step_pulses(step)

Set jog step size in pulses with sj and require GS00.

Parameters:

step (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_pulses(...)
set_velocity_percent(percent)

Set velocity/power compensation using sv (0..100 percent).

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)

Enable startup skip-frequency behavior using the sk command.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
stop(*, timeout=None)

Send st motion-stop command and return resulting status tuple.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
MODEL_CODE
MODEL_FAMILY_NAME
bus
address
motion_timeout
class ElliptecMotorized_IRIS.ELL15.DeviceInfo(address: 'str', model_code: 'int', serial_number: 'str', year: 'int', firmware_release: 'str', hardware_release: 'int', is_imperial: 'bool', travel: 'int', pulses_per_unit: 'int')[source]

Bases: object

address
model_code
serial_number
year
firmware_release
hardware_release
is_imperial
travel
pulses_per_unit
property model_name

Model name.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # model_name(...)
class ElliptecMotorized_IRIS.ELL15.Ell15(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecIrisBase

Shared-bus wrapper for a Thorlabs Elliptec ELL15 motorized iris.

This wrapper does not own the COM port. It uses an ElliptecBus instance and communicates only through addressed transactions on that shared bus.

Design notes:

  • Treats the device as a position-based closed-loop unit using the IN packet scaling factor.

  • Adds the ELL15-only auto-homing command “ah”.

  • Intentionally omits clean_mechanics(), because the manual section for “cm” does not list ELL15.

MODEL_CODE = 15
MODEL_FAMILY_NAME = 'ELL15'
set_auto_homing(enabled, *, timeout=None)[source]

ELL15-only auto-home-at-startup setting.

Parameters:
  • enabled (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # set_auto_homing(...)
DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
change_address(new_address)

Change module address with ca and update local wrapper state.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
get_home_offset_mm()

Return home offset converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_home_offset_mm(...)
get_home_offset_pulses()

Query go and return home offset in pulses from HO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_home_offset_pulses(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_iris_value_mm()

Get iris value mm.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_iris_value_mm(...)
get_jog_step_mm()

Return jog step converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_jog_step_mm(...)
get_jog_step_pulses()

Query gj and return jog step size in pulses from GJ reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_jog_step_pulses(...)
get_motor_info(motor_index)

Query i1/i2 and return parsed motor diagnostics/settings.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_position_mm()

Return current position converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_position_mm(...)
get_position_pulses()

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Query gv and return velocity/power compensation as a percentage.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
home(direction='cw', *, wait=True, timeout=None)

Send ho to move to home; optionally wait and return final pulse position.

Parameters:
  • direction (str) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # home(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
jog_backward(*, wait=True, timeout=None)

Send bw jog/backward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_backward(...)
jog_forward(*, wait=True, timeout=None)

Send fw jog/forward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_forward(...)
mm_to_pulses(mm)

Convert physical distance in mm to integer pulse units.

Parameters:

mm (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # mm_to_pulses(...)
move_absolute_mm(mm, *, wait=True, timeout=None)

Move to an absolute millimetre position using pulse conversion helpers.

Parameters:
  • mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_absolute_mm(...)
move_absolute_pulses(position, *, wait=True, timeout=None)

Send ma absolute move in pulses; optionally wait for final PO.

Parameters:
  • position (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_absolute_pulses(...)
move_relative_mm(delta_mm, *, wait=True, timeout=None)

Move by a relative millimetre offset using pulse conversion helpers.

Parameters:
  • delta_mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_relative_mm(...)
move_relative_pulses(delta, *, wait=True, timeout=None)

Send mr relative move in pulses; optionally wait for final PO.

Parameters:
  • delta (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_relative_pulses(...)
optimize_motors(*, timeout=300.0)

Run long optimization cycle via om until non-busy completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
pulses_per_mm()

Return pulses-per-millimetre conversion factor from IN info.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # pulses_per_mm(...)
pulses_to_mm(pulses)

Convert pulse counts to physical distance in mm.

Parameters:

pulses (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # pulses_to_mm(...)
save_user_data()

Persist current user/motor parameters to non-volatile memory via us.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
set_backward_period(motor_index, period)

Set resonant backward period using b1/b2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set resonant forward period using f1/f2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_home_offset_mm(mm)

Set home offset from millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_mm(...)
set_home_offset_pulses(offset)

Set home offset in pulses with so and require GS00 acknowledgement.

Parameters:

offset (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_pulses(...)
set_jog_step_mm(mm)

Set jog step in millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_mm(...)
set_jog_step_pulses(step)

Set jog step size in pulses with sj and require GS00.

Parameters:

step (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_pulses(...)
set_velocity_percent(percent)

Set velocity/power compensation using sv (0..100 percent).

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)
stop(*, timeout=None)

Send st motion-stop command and return resulting status tuple.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
bus
address
motion_timeout
class ElliptecMotorized_IRIS.ELL15.MotorInfo(address: 'str', motor_index: 'int', loop_on: 'bool', motor_ok: 'bool', current_raw: 'int', current_amps: 'float', forward_period: 'int', backward_period: 'int')[source]

Bases: object

address
motor_index
loop_on
motor_ok
current_raw
current_amps
forward_period
backward_period
class ElliptecMotorized_IRIS.ELL15Z.DeviceInfo(address: 'str', model_code: 'int', serial_number: 'str', year: 'int', firmware_release: 'str', hardware_release: 'int', is_imperial: 'bool', travel: 'int', pulses_per_unit: 'int')[source]

Bases: object

address
model_code
serial_number
year
firmware_release
hardware_release
is_imperial
travel
pulses_per_unit
property model_name

Model name.

Returns:

Result produced by this function.

Return type:

str

Example

>>> # Example
>>> # model_name(...)
class ElliptecMotorized_IRIS.ELL15Z.Ell15Z(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)[source]

Bases: ElliptecIrisExtendedBase

Shared-bus wrapper for a Thorlabs Elliptec ELL15Z motorized iris.

This wrapper does not own the COM port. It uses an ElliptecBus instance and communicates only through addressed transactions on that shared bus.

Design notes:

  • Treats the device as a position-based closed-loop unit using the IN packet scaling factor.

  • Intentionally does NOT include the “ah” command, because that command was treated as ELL15-only in the original wrapper.

MODEL_CODE = 31
MODEL_FAMILY_NAME = 'ELL15Z'
DEFAULT_MOTION_TIMEOUT = 30.0
__init__(bus, address='0', *, motion_timeout=30.0, auto_validate_model=False)

Store bus/address settings and optionally verify reported model via IN.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • address (Union[str, int]) – Input value for this operation.

  • motion_timeout (float) – Input value for this operation.

  • auto_validate_model (bool) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # __init__(...)
change_address(new_address)

Change module address with ca and update local wrapper state.

Parameters:

new_address (Union[str, int]) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # change_address(...)
clean_mechanics(*, timeout=300.0)

Run maintenance cleaning cycle via cm until completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # clean_mechanics(...)
clear_error()

Read and clear the current status/error value via gs.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # clear_error(...)
property device_info

Return cached DeviceInfo; read once from IN when first accessed.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # device_info(...)
classmethod find_devices_on_bus(bus, *, addresses='0123456789ABCDEF')

Probe candidate addresses with in and construct family-matching instances.

Parameters:
  • bus (ElliptecBus) – Input value for this operation.

  • addresses (Iterable[Union[str, int]]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

List[TDev]

Example

>>> # Example
>>> # find_devices_on_bus(...)
get_home_offset_mm()

Return home offset converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_home_offset_mm(...)
get_home_offset_pulses()

Query go and return home offset in pulses from HO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_home_offset_pulses(...)
get_info()

Query in for this device address and return parsed DeviceInfo.

Returns:

Result produced by this function.

Return type:

DeviceInfo

Example

>>> # Example
>>> # get_info(...)
get_iris_value_mm()

Get iris value mm.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_iris_value_mm(...)
get_jog_step_mm()

Return jog step converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_jog_step_mm(...)
get_jog_step_pulses()

Query gj and return jog step size in pulses from GJ reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_jog_step_pulses(...)
get_motor_info(motor_index)

Query i1/i2 and return parsed motor diagnostics/settings.

Parameters:

motor_index (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

MotorInfo

Example

>>> # Example
>>> # get_motor_info(...)
get_position_mm()

Return current position converted from pulses to millimetres.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # get_position_mm(...)
get_position_pulses()

Query gp and return current pulse position from the PO reply.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_position_pulses(...)
get_status()

Read module status using gs and return numeric code plus message.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # get_status(...)
get_velocity_percent()

Query gv and return velocity/power compensation as a percentage.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # get_velocity_percent(...)
home(direction='cw', *, wait=True, timeout=None)

Send ho to move to home; optionally wait and return final pulse position.

Parameters:
  • direction (str) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # home(...)
property is_connected

Return whether the shared serial bus is currently connected.

Returns:

Result produced by this function.

Return type:

bool

Example

>>> # Example
>>> # is_connected(...)
jog_backward(*, wait=True, timeout=None)

Send bw jog/backward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_backward(...)
jog_forward(*, wait=True, timeout=None)

Send fw jog/forward command and optionally wait for completion.

Parameters:
  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # jog_forward(...)
mm_to_pulses(mm)

Convert physical distance in mm to integer pulse units.

Parameters:

mm (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # mm_to_pulses(...)
move_absolute_mm(mm, *, wait=True, timeout=None)

Move to an absolute millimetre position using pulse conversion helpers.

Parameters:
  • mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_absolute_mm(...)
move_absolute_pulses(position, *, wait=True, timeout=None)

Send ma absolute move in pulses; optionally wait for final PO.

Parameters:
  • position (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_absolute_pulses(...)
move_relative_mm(delta_mm, *, wait=True, timeout=None)

Move by a relative millimetre offset using pulse conversion helpers.

Parameters:
  • delta_mm (float) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[float]

Example

>>> # Example
>>> # move_relative_mm(...)
move_relative_pulses(delta, *, wait=True, timeout=None)

Send mr relative move in pulses; optionally wait for final PO.

Parameters:
  • delta (int) – Input value for this operation.

  • wait (bool) – Input value for this operation.

  • timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Optional[int]

Example

>>> # Example
>>> # move_relative_pulses(...)
optimize_motors(*, timeout=300.0)

Run long optimization cycle via om until non-busy completion.

Parameters:

timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # optimize_motors(...)
pulses_per_mm()

Return pulses-per-millimetre conversion factor from IN info.

Returns:

Result produced by this function.

Return type:

int

Example

>>> # Example
>>> # pulses_per_mm(...)
pulses_to_mm(pulses)

Convert pulse counts to physical distance in mm.

Parameters:

pulses (int) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

float

Example

>>> # Example
>>> # pulses_to_mm(...)
save_user_data()

Persist current user/motor parameters to non-volatile memory via us.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # save_user_data(...)
scan_current_curve(motor_index, *, timeout=20.0)

Run current-curve scan (c1/c2) and return C1/C2 packet.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Packet

Example

>>> # Example
>>> # scan_current_curve(...)
search_frequency(motor_index, *, timeout=20.0)

Run resonance search for one motor using s1/s2.

Parameters:
  • motor_index (int) – Input value for this operation.

  • timeout (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # search_frequency(...)
set_backward_period(motor_index, period)

Set resonant backward period using b1/b2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_backward_period(...)
set_forward_period(motor_index, period)

Set resonant forward period using f1/f2 and require GS00.

Parameters:
  • motor_index (int) – Input value for this operation.

  • period (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_forward_period(...)
set_home_offset_mm(mm)

Set home offset from millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_mm(...)
set_home_offset_pulses(offset)

Set home offset in pulses with so and require GS00 acknowledgement.

Parameters:

offset (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_home_offset_pulses(...)
set_jog_step_mm(mm)

Set jog step in millimetres after pulse conversion.

Parameters:

mm (float) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_mm(...)
set_jog_step_pulses(step)

Set jog step size in pulses with sj and require GS00.

Parameters:

step (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_jog_step_pulses(...)
set_velocity_percent(percent)

Set velocity/power compensation using sv (0..100 percent).

Parameters:

percent (int) – Input value for this operation.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # set_velocity_percent(...)

Enable startup skip-frequency behavior using the sk command.

Returns:

This function does not return a value.

Return type:

None

Example

>>> # Example
>>> # skip_frequency_search(...)
stop(*, timeout=None)

Send st motion-stop command and return resulting status tuple.

Parameters:

timeout (Optional[float]) – Input value for this operation.

Returns:

Result produced by this function.

Return type:

Tuple[int, str]

Example

>>> # Example
>>> # stop(...)
bus
address
motion_timeout
class ElliptecMotorized_IRIS.ELL15Z.MotorInfo(address: 'str', motor_index: 'int', loop_on: 'bool', motor_ok: 'bool', current_raw: 'int', current_amps: 'float', forward_period: 'int', backward_period: 'int')[source]

Bases: object

address
motor_index
loop_on
motor_ok
current_raw
current_amps
forward_period
backward_period