qmi.instruments.bristol.bristol_871a
Instrument driver for the Bristol 871A Laser Wavelength Meter.
Classes
|
Instrument driver for the Bristol 871A wavelength meter. |
|
- class qmi.instruments.bristol.bristol_871a.Measurement(timestamp, index, status, wavelength, power)
- count(value, /)
Return number of occurrences of value.
- index: int
Alias for field number 1
- power: float
Alias for field number 4
- status: int
Alias for field number 2
- timestamp: float
Alias for field number 0
- wavelength: float
Alias for field number 3
- class qmi.instruments.bristol.bristol_871a.Bristol_871A(context: QMI_Context, name: str, scpi_transport: None | str, serial_transport: None | str, queue_size: int = 10000)
Instrument driver for the Bristol 871A wavelength meter.
This driver implements two connections to the instrument:
A text-based (SCPI) bidirectional channel via TCP port 23, for configuration and on-demand measurements;
A binary output channel (RS-422), emitting small packets corresponding to processed measurements.
Either of the channels (but not both) may be left unspecified at instantiation time.
- CONDITION_BITS
A dictionary mapping condition values to messages.
- STATUS_BITS
A dictionary mapping status bit indices to a descriptive message.
- DEFAULT_QUEUE_SIZE
An integer that indicates the size of the RS-422 message queue, if no value is specified in the constructor.
- RESPONSE_TIMEOUT
The timeout for SCPI commands, in seconds.
- STATUS_MASK
Bitmask value of all status bits that have a defined meaning.
- STATUS_GOOD
Status value of a wavelength measurement without any issues.
- open() None
Open the SCPI and/or serial channel to the wavemeter.
- close() None
Close the SCPI and/or serial channel to the wavemeter.
- reset() None
Reset the wavemeter using the SCPI ‘*RST’ command.
This resets (most) settings to their default values.
- get_idn() QMI_InstrumentIdentification
Read wavemeter instrument type and version
- Returns:
A QMI_InstrumentIdentification instance.
- static is_valid_measurement(measurement: Measurement) bool
Return True if the specified measurement represents a valid, accurate measured wavelength.
- read_measurement() Measurement
Read next measurement and return measured value as a Measurement instance.
- calibrate() None
Start calibration of the instrument.
Calibration takes approximately 2 seconds and interrupts measurements for its duration.
- get_auto_calibration_method() str
Return the current auto-calibration method.
- Returns: - “OFF” if auto-calibration is disabled;
“TIME” when time-driven auto-calibration enabled;
“TEMP” when temperature-driven auto-calibration enabled.
- set_auto_calibration_method(method: str) None
Set auto-calibration method.
- Parameters:
method – Valid values are “OFF” or “TIME” or “TEMP”.
- get_auto_calibration_temperature() int
Return the temperature change (in units of 0.1 degree Celsius) that will initiate recalibration.
- set_auto_calibration_temperature(delta: int) None
Set the temperature change that will initiate recalibration when temperature-driven calibration is enabled.
- Parameters:
delta – Temperature change that will initiate recalibration (in units of 0.1 degree Celsius). Valid range: 1 to 50.
- get_auto_calibration_time() int
Return the time interval [minutes] for automatic recalibration.
- set_auto_calibration_time(interval: int) None
Set the time interval for recalibration (when time-driven calibration is enabled).
- Parameters:
interval – Recalibration interval in minutes. Valid range is 5 to 1440.
- get_condition() int
Read questionable condition register.
- get_trigger_method() str
Return the current trigger method.
- Returns:
- “INT” for internal triggering;
”FALL” for external trigger on falling edge;
”RISE” for external trigger on rising edge.
- Return type:
Trigger method
- set_trigger_method(method: str) None
Set the trigger method.
- Parameters:
method – Trigger method. Valid values: “INT”, “FALL”, “RISE”.
- get_trigger_rate() int
Return current trigger rate (in Hz) for the internal trigger.
- set_trigger_rate(rate: int) None
Set trigger rate for the internal trigger.
- Parameters:
rate – Trigger rate in Hz, or 0 to adjust to optical illumination. Valid values are 20, 50, 100, 250, 500, 1000 and 0.
- 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.
- memory_start() None
Start recording samples in internal memory in the instrument.
- KNOWN FIRMWARE ISSUE: The MMEM INIT/OPEN/CLOSE/DATA? sequence often stops producing samples after running for
some hours.
- 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.
- memory_stop() None
Stop recording samples in internal memory.
- KNOWN FIRMWARE ISSUE: The MMEM INIT/OPEN/CLOSE/DATA? sequence often stops producing samples after running for
some hours.
- get_memory_contents() list[Measurement]
Fetch recorded samples from internal memory.
- KNOWN FIRMWARE ISSUE: The MMEM INIT/OPEN/CLOSE/DATA? sequence often stops producing samples after running for
some hours.
- get_streaming_measurements() list[Measurement]
Return streaming measurements received from the instrument.
If the instrument uses a serial transport (in addition to the SCPI transport), streaming measurements are received from the instrument and buffered in the driver. This method returns the list of measurements currently in the buffer and removes them from the buffer.
The buffer has a maximum size of STREAMING_QUEUE_SIZE measurements. If the buffer becomes full, old measurements are dropped automatically.
- Returns:
A list of measurements received since last call.