pylablib.devices.Arcus package
Submodules
pylablib.devices.Arcus.base module
- exception pylablib.devices.Arcus.base.ArcusError[source]
Bases:
DeviceError
Generic Arcus error
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception pylablib.devices.Arcus.base.ArcusBackendError(exc)[source]
Bases:
ArcusError
,DeviceBackendError
Generic Arcus backend communication error
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
pylablib.devices.Arcus.performax module
- pylablib.devices.Arcus.performax.get_usb_device_info(devid)[source]
Get info for the given device index (starting from 0).
Return tuple
(index, serial, model, desc, vid, pid)
.
- pylablib.devices.Arcus.performax.list_usb_performax_devices()[source]
List all performax devices.
Return list of tuples
(index, serial, model, desc, vid, pid)
, one per device.
- class pylablib.devices.Arcus.performax.GenericPerformaxStage(idx=0, conn=None)[source]
Bases:
IMultiaxisStage
Generic Arcus Performax translation stage.
- Parameters:
idx (int) – stage index; if using a USB connection, specifies a USB device index; if using RS485 connection, specifies device index on the bus
conn – if not
None
, defines a connection to RS485 connection. Usually (e.g., for USB-to-RS485 adapters) this is a serial connection, which either a name (e.g.,"COM1"
), or a tuple(name, baudrate)
(e.g.,("COM1", 9600)
); if conn isNone
, assume direct USB connection and use the manufacturer-provided DLL
- Error
alias of
ArcusError
- get_device_number()[source]
Get the device number used in RS-485 communications.
Usually it is a string with the format similar to
"4EX00"
.
- set_device_number(number, store=True)[source]
Get the device number used in RS-485 communications.
number can be either a full device id (e.g.,
"4EX00"
), or a single number between 0 and 99. In order for the change to take effect, the device needs to be power-cycled. Ifstore==True
, automatically store settings to the memory; otherwise, the settings will be lost unlessstore_defaults()
is called at some point before the power-cycle.
- store_defaults()[source]
Store some of the settings to the memory as defaults.
Applies to device number, baudrate, limit error behavior, polarity, and some other settings.
- apply_settings(settings)
Apply the settings.
settings is the dict
{name: value}
of the device available settings. Non-applicable settings are ignored.
- get_all_axes()
Get the list of all available axes (taking mapping into account)
- get_device_variable(key)
Get the value of a settings, status, or full info parameter
- get_full_info(include=0)
Get dict
{name: value}
containing full device information (including status and settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_full_status(include=0)
Get dict
{name: value}
containing the device status (including settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_settings(include=0)
Get dict
{name: value}
containing all the device settings.include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- remap_axes(mapping, accept_original=True)
Rename axes to the new labels.
mapping is the new axes mapping, which can be a list of new axes name (corresponding to the old axes in order returned by
get_all_axes()
), or a dictionary{alias: original}
of the new axes aliases.
- set_device_variable(key, value)
Set the value of a settings parameter
- class pylablib.devices.Arcus.performax.Performax4EXStage(idx=0, conn=None, enable=True)[source]
Bases:
GenericPerformaxStage
Arcus Performax 4EX/4ET translation stage.
- Parameters:
idx (int) – stage index; if using a USB connection, specifies a USB device index; if using RS485 connection, specifies device index on the bus
conn – if not
None
, defines a connection to RS485 connection. Usually (e.g., for USB-to-RS485 adapters) this is a serial connection, which either a name (e.g.,"COM1"
), or a tuple(name, baudrate)
(e.g.,("COM1", 9600)
); if conn isNone
, assume direct USB connection and use the manufacturer-provided DLLenable – if
True
, enable all axes on startup
- set_baudrate(baudrate, store=True)[source]
Set current baud rate.
Acceptable values are 9600 (default), 19200, 38400, 57600, and 115200. In order for the change to take effect, the device needs to be power-cycled. If
store==True
, automatically store settings to the memory; otherwise, the settings will be lost unlessstore_defaults()
is called at some point before the power-cycle.
- enable_limit_errors(enable=True, autoclear=True)[source]
Enable limit errors.
If on, reaching limit switch on an axis puts it into an error state, which immediately stops this an all other axes; any further motion command on this axis will raise an error (it is still possible to restart motion on other axes); the axis motion can only be resumed by calling
clear_limit_error()
. If off, the limited axis still stops, but the other axes are unaffected. Ifautoclear==True
andenable==False
, also clear the current limit errors on all exs.
- limit_errors_enabled()[source]
Check if global limit errors are enabled.
If on, reaching limit switch on an axis puts it into an error state, which immediately stops this an all other axes; any further motion command on this axis will raise an error (it is still possible to restart motion on other axes); the axis motion can only be resumed by calling
clear_limit_error()
. If off, the limited axis still stops, but the other axes are unaffected.
- enable_axis(axis='all', enable=True)[source]
Enable axis output.
If the output is disabled, the steps are generated by the controller, but not sent to the motors.
- set_position_reference(axis, position=0)[source]
Set the current axis pulse position as a reference.
Re-calibrate the pulse position counter so that the current position is set as position (0 by default).
- set_encoder_reference(axis, position=0)[source]
Set the current axis encoder value as a reference.
Re-calibrate the encoder counter so that the current position is set as position (0 by default).
- jog(axis, direction)[source]
Jog a given axis in a given direction.
direction can be either
"-"
(negative) or"+"
(positive). The motion continues until it is explicitly stopped, or until a limit is hit.
- stop(axis='all', immediate=False)[source]
Stop motion of a given axis.
If
immediate==True
make an abrupt stop; otherwise, slow down gradually.
- home(axis, direction, home_mode)[source]
Home the given axis using a given home mode.
direction can be
"+"
or"-"
The mode can be"only_home_input"
,"only_home_input_lowspeed"
,"only_limit_input"
,"only_zidx_input"
, or"home_and_zidx_input"
. For meaning, see Arcus PMX manual.
- get_global_speed()[source]
Get the global speed setting (in Hz); overridden by a non-zero axis speed
- get_axis_speed(axis='all')[source]
Get the individual axis speed setting (in Hz); 0 means that the global speed is used
- set_global_speed(speed)[source]
Set the global speed setting (in Hz); overridden by a non-zero axis speed
- set_axis_speed(axis, speed)[source]
Set the individual axis speed setting (in Hz); 0 means that the global speed is used
- check_limit_error(axis='all')[source]
Check if the axis hit limit errors.
Return
""
(not errors),"+"
(positive limit error) or"-"
(negative limit error).
- set_digital_output(channel, value)[source]
Set value (0 or 1) at a given digital output (1 through 8)
- Error
alias of
ArcusError
- apply_settings(settings)
Apply the settings.
settings is the dict
{name: value}
of the device available settings. Non-applicable settings are ignored.
- close()
Close the connection to the stage
- get_all_axes()
Get the list of all available axes (taking mapping into account)
- get_device_info()
Get the device info
- get_device_number()
Get the device number used in RS-485 communications.
Usually it is a string with the format similar to
"4EX00"
.
- get_device_variable(key)
Get the value of a settings, status, or full info parameter
- get_full_info(include=0)
Get dict
{name: value}
containing full device information (including status and settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_full_status(include=0)
Get dict
{name: value}
containing the device status (including settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_settings(include=0)
Get dict
{name: value}
containing all the device settings.include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- is_opened()
Check if the device is connected
- open()
Open the connection to the stage
- query(comm)
Send a query to the stage and return the reply
- remap_axes(mapping, accept_original=True)
Rename axes to the new labels.
mapping is the new axes mapping, which can be a list of new axes name (corresponding to the old axes in order returned by
get_all_axes()
), or a dictionary{alias: original}
of the new axes aliases.
- set_device_number(number, store=True)
Get the device number used in RS-485 communications.
number can be either a full device id (e.g.,
"4EX00"
), or a single number between 0 and 99. In order for the change to take effect, the device needs to be power-cycled. Ifstore==True
, automatically store settings to the memory; otherwise, the settings will be lost unlessstore_defaults()
is called at some point before the power-cycle.
- set_device_variable(key, value)
Set the value of a settings parameter
- store_defaults()
Store some of the settings to the memory as defaults.
Applies to device number, baudrate, limit error behavior, polarity, and some other settings.
- class pylablib.devices.Arcus.performax.Performax2EXStage(idx=0, conn=None, enable=True)[source]
Bases:
Performax4EXStage
Arcus Performax 2EX/2ED translation stage.
- Parameters:
idx (int) – stage index; if using a USB connection, specifies a USB device index; if using RS485 connection, specifies device index on the bus
conn – if not
None
, defines a connection to RS485 connection. Usually (e.g., for USB-to-RS485 adapters) this is a serial connection, which either a name (e.g.,"COM1"
), or a tuple(name, baudrate)
(e.g.,("COM1", 9600)
); if conn isNone
, assume direct USB connection and use the manufacturer-provided DLLenable – if
True
, enable all axes on startup
- Error
alias of
ArcusError
- apply_settings(settings)
Apply the settings.
settings is the dict
{name: value}
of the device available settings. Non-applicable settings are ignored.
- check_limit_error(axis='all')
Check if the axis hit limit errors.
Return
""
(not errors),"+"
(positive limit error) or"-"
(negative limit error).
- clear_limit_error(axis='all')
Clear axis limit errors
- close()
Close the connection to the stage
- enable_absolute_mode(enable=True)
Set absolute motion mode
- enable_axis(axis='all', enable=True)
Enable axis output.
If the output is disabled, the steps are generated by the controller, but not sent to the motors.
- enable_limit_errors(enable=True, autoclear=True)
Enable limit errors.
If on, reaching limit switch on an axis puts it into an error state, which immediately stops this an all other axes; any further motion command on this axis will raise an error (it is still possible to restart motion on other axes); the axis motion can only be resumed by calling
clear_limit_error()
. If off, the limited axis still stops, but the other axes are unaffected. Ifautoclear==True
andenable==False
, also clear the current limit errors on all exs.
- get_all_axes()
Get the list of all available axes (taking mapping into account)
- get_analog_input(channel)
Get voltage (in V) at a given input (starting with 1)
- get_axis_speed(axis='all')
Get the individual axis speed setting (in Hz); 0 means that the global speed is used
- get_baudrate()
Get current baud rate
- get_current_axis_speed(axis='all')
Get the instantaneous speed (in Hz)
- get_device_info()
Get the device info
- get_device_number()
Get the device number used in RS-485 communications.
Usually it is a string with the format similar to
"4EX00"
.
- get_device_variable(key)
Get the value of a settings, status, or full info parameter
- get_digital_input(channel)
Get value (0 or 1) at a given digital input (1 through 8)
- get_digital_input_register()
Get all 8 digital inputs as a single 8-bit integer
- get_digital_output(channel)
Get value (0 or 1) at a given digital output (1 through 8)
- get_digital_output_register()
Get all 8 digital inputs as a single 8-bit integer
- get_encoder(axis='all')
Get the current axis encoder value
- get_full_info(include=0)
Get dict
{name: value}
containing full device information (including status and settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_full_status(include=0)
Get dict
{name: value}
containing the device status (including settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_global_speed()
Get the global speed setting (in Hz); overridden by a non-zero axis speed
- get_position(axis='all')
Get the current axis pulse position
- get_settings(include=0)
Get dict
{name: value}
containing all the device settings.include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_status(axis='all')
Get the axis status as a set of string descriptors
- get_status_n(axis='all')
Get the axis status as an integer
- home(axis, direction, home_mode)
Home the given axis using a given home mode.
direction can be
"+"
or"-"
The mode can be"only_home_input"
,"only_home_input_lowspeed"
,"only_limit_input"
,"only_zidx_input"
, or"home_and_zidx_input"
. For meaning, see Arcus PMX manual.
- is_enabled(axis='all')
Check if the axis output is enabled
- is_moving(axis='all')
Check if a given axis is moving
- is_opened()
Check if the device is connected
- jog(axis, direction)
Jog a given axis in a given direction.
direction can be either
"-"
(negative) or"+"
(positive). The motion continues until it is explicitly stopped, or until a limit is hit.
- limit_errors_enabled()
Check if global limit errors are enabled.
If on, reaching limit switch on an axis puts it into an error state, which immediately stops this an all other axes; any further motion command on this axis will raise an error (it is still possible to restart motion on other axes); the axis motion can only be resumed by calling
clear_limit_error()
. If off, the limited axis still stops, but the other axes are unaffected.
- move_by(axis, steps=1)
Move a given axis for a given number of steps
- move_to(axis, position)
Move a given axis to a given position
- open()
Open the connection to the stage
- query(comm)
Send a query to the stage and return the reply
- remap_axes(mapping, accept_original=True)
Rename axes to the new labels.
mapping is the new axes mapping, which can be a list of new axes name (corresponding to the old axes in order returned by
get_all_axes()
), or a dictionary{alias: original}
of the new axes aliases.
- set_axis_speed(axis, speed)
Set the individual axis speed setting (in Hz); 0 means that the global speed is used
- set_baudrate(baudrate, store=True)
Set current baud rate.
Acceptable values are 9600 (default), 19200, 38400, 57600, and 115200. In order for the change to take effect, the device needs to be power-cycled. If
store==True
, automatically store settings to the memory; otherwise, the settings will be lost unlessstore_defaults()
is called at some point before the power-cycle.
- set_device_number(number, store=True)
Get the device number used in RS-485 communications.
number can be either a full device id (e.g.,
"4EX00"
), or a single number between 0 and 99. In order for the change to take effect, the device needs to be power-cycled. Ifstore==True
, automatically store settings to the memory; otherwise, the settings will be lost unlessstore_defaults()
is called at some point before the power-cycle.
- set_device_variable(key, value)
Set the value of a settings parameter
- set_digital_output(channel, value)
Set value (0 or 1) at a given digital output (1 through 8)
- set_digital_output_register(value)
Set all 8 digital inputs as a single 8-bit integer
- set_encoder_reference(axis, position=0)
Set the current axis encoder value as a reference.
Re-calibrate the encoder counter so that the current position is set as position (0 by default).
- set_global_speed(speed)
Set the global speed setting (in Hz); overridden by a non-zero axis speed
- set_position_reference(axis, position=0)
Set the current axis pulse position as a reference.
Re-calibrate the pulse position counter so that the current position is set as position (0 by default).
- stop(axis='all', immediate=False)
Stop motion of a given axis.
If
immediate==True
make an abrupt stop; otherwise, slow down gradually.
- store_defaults()
Store some of the settings to the memory as defaults.
Applies to device number, baudrate, limit error behavior, polarity, and some other settings.
- wait_move(axis, timeout=None, period=0.05)
Wait until motion is done
- class pylablib.devices.Arcus.performax.PerformaxDMXJSAStage(idx=0, conn=None, enable=True, autoclear=True)[source]
Bases:
GenericPerformaxStage
Arcus Performax DMX-J-SA translation stage.
- Parameters:
idx (int) – stage index; if using a USB connection, specifies a USB device index; if using RS485 connection, specifies device index on the bus
conn – if not
None
, defines a connection to RS485 connection. Usually (e.g., for USB-to-RS485 adapters) this is a serial connection, which either a name (e.g.,"COM1"
), or a tuple(name, baudrate)
(e.g.,("COM1", 9600)
); if conn isNone
, assume direct USB connection and use the manufacturer-provided DLLenable – if
True
, enable all axes on startupautoclear – if
True
, automatically clear limit error before the motion start
- enable_axis(enable=True)[source]
Enable output.
If the output is disabled, the steps are generated by the controller, but not sent to the motors.
- set_position_reference(position=0)[source]
Set the current pulse position as a reference.
Re-calibrate the pulse position counter so that the current position is set as position (0 by default).
- jog(direction)[source]
Jog in a given direction.
direction can be either
"-"
(negative) or"+"
(positive). The motion continues until it is explicitly stopped, or until a limit is hit.
- stop(immediate=False)[source]
Stop motion.
If
immediate==True
make an abrupt stop; otherwise, slow down gradually.
- home(direction, home_mode)[source]
Home using a given home mode.
direction can be
"+"
or"-"
The mode can be"only_home_input"
,"only_home_input_lowspeed"
, or"only_limit_input"
. For meaning, see Arcus PMX manual.
- check_limit_error()[source]
Check if the motor hit limit errors.
Return
""
(not errors),"+"
(positive limit error) or"-"
(negative limit error).
- Error
alias of
ArcusError
- apply_settings(settings)
Apply the settings.
settings is the dict
{name: value}
of the device available settings. Non-applicable settings are ignored.
- close()
Close the connection to the stage
- get_all_axes()
Get the list of all available axes (taking mapping into account)
- get_device_info()
Get the device info
- get_device_number()
Get the device number used in RS-485 communications.
Usually it is a string with the format similar to
"4EX00"
.
- get_device_variable(key)
Get the value of a settings, status, or full info parameter
- get_full_info(include=0)
Get dict
{name: value}
containing full device information (including status and settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_full_status(include=0)
Get dict
{name: value}
containing the device status (including settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_settings(include=0)
Get dict
{name: value}
containing all the device settings.include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- is_opened()
Check if the device is connected
- open()
Open the connection to the stage
- query(comm)
Send a query to the stage and return the reply
- remap_axes(mapping, accept_original=True)
Rename axes to the new labels.
mapping is the new axes mapping, which can be a list of new axes name (corresponding to the old axes in order returned by
get_all_axes()
), or a dictionary{alias: original}
of the new axes aliases.
- set_device_number(number, store=True)
Get the device number used in RS-485 communications.
number can be either a full device id (e.g.,
"4EX00"
), or a single number between 0 and 99. In order for the change to take effect, the device needs to be power-cycled. Ifstore==True
, automatically store settings to the memory; otherwise, the settings will be lost unlessstore_defaults()
is called at some point before the power-cycle.
- set_device_variable(key, value)
Set the value of a settings parameter
- set_digital_output(channel, value)[source]
Set value (0 or 1) at a given digital output (1 through 2)
- store_defaults()
Store some of the settings to the memory as defaults.
Applies to device number, baudrate, limit error behavior, polarity, and some other settings.