The pfeiffer_qmg422 module

Autogenerated API documentation for pfeiffer_qmg422

This module contains the driver code for the QMG422 control box for a pfeiffer mass-spectrometer. The code should in principle work for multiple type of electronics. It has so far been tested with a qme-125 box and a qme-??? box. The module is ment as a driver and has very little function in itself. The module is ment to be used as a sub-module for a large program providing the functionality to actually use the mass-spectrometer.

Known bugs: Not all code has a proper distinction between the various electronics. The qme-125 has many limitations compared to the qme-??? and these limitations are not always properly expressed in the code or the output of the module

class PyExpLabSys.drivers.pfeiffer_qmg422.qmg_422(port='/dev/ttyS0', speed=19200)[source]

Bases: object

The actual driver class.

__init__(port='/dev/ttyS0', speed=19200)[source]

Initialize the module


Communicates with Baltzers/Pferiffer Mass Spectrometer

Implements the low-level protocol for RS-232 communication with the instrument. High-level protocol can be implemented using this as a helper

Parameters:command (str) – The command to send
Returns:The reply associated with the last command
Return type:str

Returns and sets the communication mode.

Parameters:computer_control (bool) – Activates ASCII communication with the device
Returns:The current communication mode
Return type:str

Chekcs wheter the instruments returns real or simulated data

Returns:Message telling whether the device is in simulation mode
Return type:str

Set the current channel :param channel: The channel number :type channel: integer


Read the SEM Voltage :return: The SEM voltage :rtype: str


Read the preamp range This function is not fully implemented :return: The preamp range :rtype: str


Reads the integration period of a measurement :return: The integration period in non-physical unit :rtype: str

sem_status(voltage=-1, turn_off=False, turn_on=False)[source]

Get or set the SEM status :param voltage: The wanted SEM-voltage :type voltage: integer :param turn_off: If True SEM will be turned on (unless turn_of==True) :type turn_off: boolean :param turn_on: If True SEM will be turned off (unless turn_on==True) :type turn_on: boolean :return: The SEM voltage, The SEM status, True means voltage on :rtype: integer, boolan

emission_status(current=-1, turn_off=False, turn_on=False)[source]

Get or set the emission status. :param current: The wanted emission status. Only works for QME??? :type current: integer :param turn_off: If True emission will be turned on (unless turn_of==True) :type turn_off: boolean :param turn_on: If True emission will be turned off (unless turn_on==True) :type turn_on: boolean :return: The emission value (for QME???), The emission status, True means filament on :rtype: integer, boolan

detector_status(SEM=False, faraday_cup=False)[source]

Choose between SEM and Faraday cup measurements


Read the qme-voltages


Update the knowledge of the internal knowledge of the instrument


Start the measurement


Returns the range that should be send to achieve the desired range


Read a single sample from the device


Read multiple samples from the device

config_channel(channel, mass=-1, speed=-1, enable='', amp_range=0)[source]

Config a MS channel for measurement


Check if a measurement is running


Return number of waiting samples

mass_scan(first_mass, scan_width, amp_range=0)[source]

Setup the mass spec for a mass scan


Setup the mass spec for a mass-time measurement