qmi.instruments.pi.e873
Instrument driver for the PhysikInstrumente E-873 Servo Controller.
Classes
|
Instrument driver for the PhysikInstrumente E-873 Servo Controller. |
|
Type of reference signal/approach. |
|
Target position of reference move. |
|
|
|
- class qmi.instruments.pi.e873.ReferenceTarget(value)
Target position of reference move.
- class qmi.instruments.pi.e873.ReferenceSignalMode(value)
Type of reference signal/approach.
- class qmi.instruments.pi.e873.StageInfo(type, serial_number, assembly_date, hw_version)
- assembly_date: str
Alias for field number 2
- count(value, /)
Return number of occurrences of value.
- hw_version: str
Alias for field number 3
- index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.
- serial_number: str
Alias for field number 1
- type: str
Alias for field number 0
- class qmi.instruments.pi.e873.SystemStatus(negative_limit_switch, reference_point_switch, positive_limit_switch, digital_input, error_flag, servo_mode, in_motion, on_target)
- count(value, /)
Return number of occurrences of value.
- digital_input: Tuple[bool, bool, bool, bool]
Alias for field number 3
- error_flag: bool
Alias for field number 4
- in_motion: bool
Alias for field number 6
- index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.
- negative_limit_switch: bool
Alias for field number 0
- on_target: bool
Alias for field number 7
- positive_limit_switch: bool
Alias for field number 2
- reference_point_switch: bool
Alias for field number 1
- servo_mode: bool
Alias for field number 5
- class qmi.instruments.pi.e873.PI_E873(context: QMI_Context, name: str, transport: str)
Instrument driver for the PhysikInstrumente E-873 Servo Controller.
- open() None
Connect to the instrument hardware.
When this method returns, the instrument must be ready for interaction via calls to instrument-specific methods.
Subclasses can extend this method to implement instrument-specific initialization. If they do, they should call
super().open()as a last statement.
- close() None
Close the connection to the instrument hardware and release associated resources.
When this method returns, the instrument must not be used again unless it is first re-opened by calling the open() method.
Subclasses can extend this method if they have specific resources to close. If they do, they should call
super().close()as a last statement.
- reset() None
Reboot the instrument, returning (most) settings to their defaults.
- get_idn() QMI_InstrumentIdentification
Read instrument type and version and return QMI_InstrumentIdentification instance.
- get_error() int
Return last error code and clear error register.
Note most commands functions in this driver will automatically check the error register after sending the command.
- Returns:
Error core, or 0 if no error occurred since last command.
- get_system_status() SystemStatus
Request system status information.
- Returns:
16-bit status code
- stop_all() None
Stop motion abruptly and stop macro execution.
- stop_smooth() None
Stop motion smoothly (taking deceleration into account).
- get_physical_unit() str
Return physical unit used for axis positions.
- get_position_range() Tuple[float, float]
Return range of commandable positions.
- Returns:
Range as tuple (min_pos, max_pos) in physical units.
- get_max_position_error() float
Return the maximum allowed position error before the controller stops.
- get_max_velocity() float
Return the maximum closed-loop velocity in phys_unit/second.
- get_max_acceleration() float
Return the maximum closed-loop acceleration in phys_unit/second/second.
- get_max_deceleration() float
Return the maximum closed-loop deceleration in phys_unit/second/second.
- get_reference_signal_mode() ReferenceSignalMode
Return the method used by the motor controller to find the reference point.
- get_reference_velocity() float
Return the velocity used for reference moves.
- set_acceleration(accel: float) None
Set acceleration for closed-loop motion.
- Parameters:
accel – Acceleration in phys_unit/second/second.
- get_acceleration() float
Get acceleration for closed-loop motion.
- Returns:
Acceleration in phys_unit/second/second.
- set_deceleration(decel: float) None
Set deceleration for closed-loop motion.
- Parameters:
decel – Deceleration in phys_unit/second/second.
- get_deceleration() float
Get deceleration for closed-loop motion.
- Returns:
Deceleration in phys_unit/second/second.
- set_velocity(velocity: float) None
Set velocity for closed-loop motion.
- Parameters:
velocity – Velocity is phys_unit/second.
- get_velocity() float
Get velocity for closed-loop motion.
- Returns:
Velocity in phys_unit/second.
- set_servo_mode(enable: bool) None
Enable or disable closed-loop servo operation.
Servo mode must be enabled for reference moves and for closed-loop positioning.
- get_servo_mode() bool
Return True if closed-loop servo mode is active.
- set_reference_definition_mode(force_reference: bool) None
Set reference point definition mode.
- Parameters:
force_reference – True if a reference move is required for closed-loop operation; False if relative moves are allowed on an unreferenced axis.
- get_reference_definition_mode() bool
Return reference point definition mode.
- Returns:
True if a reference move is required for closed-loop operation; False if relative moves are allowed on an unreferenced axis.
- reference_move(target: ReferenceTarget = ReferenceTarget.REFERENCE_POINT) None
Start a reference move to a well-defined position.
When the axis reaches the target position, the absolute position of the axis is reset to the known position of the target. From that moment on, the axis is referenced and absolute closed-loop motion is possible.
Servo mode must be enabled before calling this function. See set_servo_mode().
Motion of the axis may continue after this function returns. Call get_system_status() to determine when motion is complete. Call stop_smooth() to abort the reference move.
- Parameters:
target – Target of reference move. REFERENCE_POINT means move to the positive or negative axis limit (depending on stage parameters), then move back to the reference point. POSITIVE_LIMIT means move to the positive axis limit. NEGATIVE_LIMIT means move to the negative axis limit.
- get_reference_result() bool
Return True if the axis is referenced (absolute position is known).
- Returns:
True if axis is referenced, False if axis is not referenced.
- move_absolute(position: float) None
Start closed-loop motion to absolute position.
The axis must be referenced before absolute motion is possible. See reference_move().
Motion of the axis may continue after this function returns. Call get_system_status() to determine when motion is complete. Call stop_smooth() to abort the reference move.
- Parameters:
position – Target position in physical units.
- move_relative(displacement: float) None
Start closed-loop motion to a target relative to the current position.
Before calling this function, servo mode must be enabled and either the axis must be referenced or using an unreferenced axis must be allowed. See set_reference_definition_mode().
Motion of the axis may continue after this function returns. Call get_system_status() to determine when motion is complete. Call stop_smooth() to abort the reference move.
- Parameters:
displacement – Displacement (in physical units) from current position to target.
- get_target_position() float
Get target position of axis.
- Returns:
Target position in physical units.
- get_position() float
Get current absolute position of axis.
- Returns:
Current position in physical units.
- wait_motion_complete(timeout: float | None = None) bool
Wait until the current motion ends.
- Parameters:
timeout – Maximum time to wait in seconds, or None to wait indefinitely.
- Returns:
True if motion complete, False if timeout expired before motion complete.
- set_trigger_inmotion(dig_out: int) None
Set digital output to be active as the axis is in motion.
- Parameters:
dig_out – Digital output line (range 1 to 4)
- set_trigger_position_offset(dig_out: int, step: float, start: float, stop: float) None
Set digital output to pulse at specified position intervals.
The first pulse is triggered when the axis has reached the specified offset position. Subsequent pulses are triggered each time the axis position equals the sum of the last trigger position and the specified step size. Trigger output ends when the axis position exceeds the specified stop position.
- Parameters:
dig_out – Digital output line (range 1 to 4).
step – Position increment (physical units) between output pulses. This parameter must be negative if the axis moves in negative direction.
start – Position (physical units) of first output pulse..
stop – Position (physical units) where the output pulse stops.
- set_trigger_output_state(dig_out: int, enable: bool) None
Enable or disable trigger output on the specified digital output line.
- get_trigger_output_state(dig_out: int) bool
Return True if trigger output is enabled on the specified digital output line.
- set_digital_output(dig_out: int, state: bool) None
Switch the specified digital output line to the specified state.
This command must not be used on digital lines for which the trigger output is enabled.
- Parameters:
dig_out – Digital output line (range 1 to 4).
state – True to set line high, False to set line low.
- get_digital_input(dig_in: int) bool
Read the state of the specified digital input line.
- Parameters:
dig_in – Digital input line (range 1 to 4).
- Returns:
True if the input signal is high, False if the signal is low.
- define_macro(name: str, commands: List[str]) None
Define a new macro.
- Parameters:
name – Name of the new macro.
commands – List of command strings to put in the macro.
- delete_macro(name: str) None
Delete the specified macro.
- get_defined_macros() List[str]
Return a list of names of all defined macros.
- start_macro(name: str, arg1: str | None = None, arg2: str | None = None, repeat: int = 1) None
Start the specified macro one or more times.
This function returns immediately after starting the macro. While the macro executes, the controller can process other commands. Only one macro can run at a time.
If any command executed by the macro causes an error, the error status will appear in the global error register. A subsequent direct command to the controller may then report the pending error which was caused by the macro. To avoid this, call get_error() after macro execution completes to reset the global error register.
Call stop_all() to abort all running macros.
- Parameters:
arg1 – Optional argument to load into VAR 1.
arg2 – Optional argument to load into VAR 2.
repeat – Number of executions of the macro (default 1).
- get_running_macros() List[str]
Return a list of names of currently running macros.
- set_variable(name: str, value: str | None) None
Set the value of a global variable.
- Parameters:
name – Name of the variable.
value – New value for the variable, or None to delete the variable.
- get_variable(name: str) str
Get the value of a global variable.
- Parameters:
name – Name of the variable.
- Returns:
Current value of the variable.
- get_variables() Mapping[str, str]
Get all global variables.
- Returns:
Dictionary of name, value pairs.
- force_unlock() None
Forcefully unlock the remote object.
This unlocks the object, regardless of who owns the lock. This allows you to unlock an object if the locking proxy has been destroyed without unlocking.
Use this with care.
Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.
- classmethod get_category() str | None
Return the optional name of the category this object belongs to.
A category name is a free-form string that has no special significance. Its purpose is to distinguish between groups of RPC objects that fulfill similar roles.
- get_name() str
Return the name of this object.
- Returns:
name attribute.
- get_signals() list[SignalDescription]
Return a list of signals that can be published by this object.
- Returns:
List consisting of qmi_signals attributes.
- is_locked() bool
Query if the remote object is locked.
Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.
- is_open() bool
Return True if the instrument is open (ready for interaction).
- lock(timeout: float = 0.0, lock_token: str | None = None) bool
Lock the remote object. If timeout is given, try every 0.1s within the given timeout value. The remote object can be locked with an optional custom lock token by giving a string into lock_token keyword argument.
If successful, this proxy is the only proxy that can invoke RPC methods on the remote object; other proxies will receive an “object is locked” response. The return value indicates if the lock was granted; a denied lock means the object was already locked by another proxy.
Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.
- release_rpc_object() None
Give a warning if the instrument is removed while still open.
- unlock(lock_token: str | None = None) bool
Unlock the remote object.
Without optional parameters, this is only allowed by the proxy that initially locked the object. By giving the lock token as an input parameter, the specific object locked by this token can be unlocked. The return value indicates if the unlocking was successful.
Do not override this stub method in subclasses. It has already been implemented in QMI_RpcProxy.