How to read or write data using Python

Description of how to retrieve measurement data from a controller for data analysis, manipulation, or reporting using Python


Python is a computer programming language often used to build websites and software, automate tasks, and conduct data analysis. Python is a general-purpose language, meaning it can be used to create a variety of different programs and isn't specialized for any specific problems.

Gantner Instruments provides a C API for reading measurement data from a controller directly read into a Python program. This C API is called eGateHighSpeedPort API and is part of the GInsData Library. This library is available as a 32/64-bit DLL for Windows (giutility.dll) or Linux (

The latest releases of Python can be downloaded here:

ctypes package

To use the eGateHighSpeedPort API, Gantner Instruments provides an interface to the necessary DLL functions. The DLL call within the package is done with the ctypes package. This is a foreign function library for Python. It provides C-compatible data types and allows calling functions in DLLs or shared libraries.

For example:

from ctypes import*
import ctypes
# Load DLL into memory, take care to have the corresponding dll available
GINSDll = ctypes.cdll.LoadLibrary("giutility_x64.dll")
print("64 bit DLL imported")
except OSError:
GINSDll = ctypes.cdll.LoadLibrary("giutility_x86.dll")
print("32 bit DLL imported")
# function prototypes: specifying the required argument types
# function call:

The DLL functions are simplified for ease of use in Python:

# Load Package
import ginsapy.giutility.connect.PyQStationConnectWin as Qstation #module with communication functions to Gantner Q.Station under windows environment
#initialize buffer connection
#Return some information of the controller
#Call function to store buffer into the variable buffer

GinsAPy package

Basic GInsData functionality is implemented in different Python modules and classes. All of the interface scripts, with examples and documentation, are delivered in an interface package called GinsAPy.


The package documentation is hosted here: GinsAPy documentation.

The following examples are part of the package. Additional libraries need to be installed to run the examples.

  • Read UDBF file (data logger file)

  • Connect to a controller

  • Write an online value to a controller
  • Read a data stream

  • Write a data stream

You can open an interactive menu to run examples from the command prompt (ensure that the PyQtGraph package is installed).

python -m ginsapy.examples

You can also execute the following Python code:

import ginsapy.examples as gins_ex

The following GUI should open:

GinsAPy download

Download link of GinsApy:

Additional libraries

The only external package you need to run efficiently in the GinsAPy package is NumPy

To run the examples the following libraries should be installed:

You can either install the package in your project directory and call the communication methods directly from your project root directory,

import ginsapy.giutility.connect.PyQStationConnectWin as Qstation

or install the package,

pip install ginsapy-xxxxxxxxxxxxx.whl

and call the methods in the same way (now independent from your execution directory).

import ginsapy.giutility.connect.PyQStationConnectWin as Qstation