Package: gammaionctl-tspspi
Unofficial Gamma ion pump ethernet control CLI utility and libraryThis is a mini Python 3 library and utility that exposes some of the functions
of the Gamma Vacuum QPC ion pump controller via a CLI or via a library class
via it's Ethernet port.Note: This utility is in no way associated with Gamma Vacuum and isnotan official product. It's just a simple tool that emerged out of my
requirements to interact with their pump controllers. There is no guarantee that
this utility will work under any circumstances, won't damage your controller
or will work after firmware upgrades, etc.InstallationThis package can be installed bypip. Depending on the environment
and operating system:python -m pip install gammaionctl-tspspior simplypip install gammaionctl-tspspiIn case one does not want to usepipone can also simply copysrc/gammaionctl/gammaionctl.pyand import from this file. There are no additional dependencies for the library.UninstallingUninstalling the package is also directly possible usingpipif it has
been installed that way:python -m pip uninstall gammaionctl-tspspiorpip uninstall gammaionctl-tspspiLibrary APIThe library exposes a singleGammaIonPumpclass inside thegammactlpackage.Creating an instance / connectingTo connect to an ion pump controller one simply instantiates theGammaIonPumpclass passing the remote host address - one can either do this explicit and call
close after one's done:pump = GammaIonPump("10.0.0.11")
# ...
pump.close()Or one can use thewithconstruct which is highly encouraged:with GammaIonPump("10.0.0.11") as pump:
    # Do whatever you wantThere is asetVerbosemethod that one can use to dump debug information
onstdout. This is primarily thought for debugging purposes during
development though. To enable verbose mode one can simply executepump.setVerbose(True)Error handlingAll methods either:Return a valueReturnNonein case there is no measurement value such as pressure for a
disabled pump - in this case the connection stays activeFalsein case of I/O or network errors as well as protocol violations. In
this case the connection is dropped and no further commands are possible until
one reconnects by reinstantiation of the connection object.Identifying the controllerTheidentifymethod returns the identification string of the controller
orFalsein case of failure.Example:id = pump.identify()
print(id) # Prints "DIGITEL QPC" for our controllerGetting estimated vacuum pressureThe pumps are able to estimate the current pressure inside the pump volume based
on their pumping current. The pump index has to be 1-4 for the quad pump controller.The method returns either:the pressure in millibar asfloatNonein case there is no measurement value (for example because the
pump is currently disabled)Falsein case of a protocol violation. Then the connection has been dropped.# Querying pressure for pump 1
pressure = pump.getPressure(1)Getting pump voltageFor every pump one can query the pump voltage of the ion pump usinggetVoltage.
Again the pump index has to be 1-4 for the quad pump controller.The method returns either:the voltage in Volts asfloat.Nonein case there is no measurement value. Note that for a disabled pump
there is a standby current in the range of a few tens of volts that seems to be
used to detect if there is an pump attached.Falsein case of a protocol violation. Then the connection has been dropped.# Querying voltage for pump 1
volts = pump.getVoltage(1)Getting pump currentFor every pump one can query the pump current of the ion pump usinggetCurrent.
Again the pump index has to be 1-4 for the quad pump controller.The method returns either:the current in Millivolts asfloat.Nonein case there is no measurement value (for example for a disabled pump)Falsein case of a protocol violation. Then the connection has been dropped.# Querying current for pump 1
amps = pump.getCurrent(1)Querying the pump sizeUsinggetPumpSizeone can query the pump capacity of the pump in liters
per second (L/S) for a pump index in the range from 1-4 for the quad pump
controller.The method returns either:the pump capacity in liters per second asint.Nonein case there is no configured size (in case no pump is connected
for example)Falsein case of a protocol violation. Then the connection has been dropped.# Querying pump capacity for pump 1
capacity = pump.getPumpSize(1)Querying the current supply statusIn addition (for human interfacing) one can query the supply status - the string
shown on the controllers display - for every pump. This is done usinggetSupplyStatusagain for a pump index in the range from 1-4 for the quad pump controller.The method returns either:the pump status asstring.Falsein case of a protocol violation. Then the connection has been dropped.# Querying pump status for pump 1
status = pump.getSupplyStatus(1)Starting and stopping a pumpTo enable a pump that's currently disabled on can use theenablemethod,
to stop a running pump thedisablemethod. These methods of course also
require the pump index. They either returnTruein case the operation
succeeded (note this is idempotent so disabling a disabled pump is successful)
orFalsein case of a protocol violation or connection error in which case
the connection has been dropped.# Enabling pump 1
pump.enable(1)
# Disabling pump 1
pump.disable(1)