CETONI SDK for SiLA 2

# SiLA 2 Introduction

SiLA stands for Standardization in Lab Automation. The mission of SiLA is to create an international, open connectivity standard in lab automation. It is is a communication standard for laboratory instruments, such as readers, liquid handling robots, chromatography and other analytical equipment. You can find more information about SiLA on the official SiLA website or in this interesting blog post about SiLA.

The CETONI SiLA 2 drivers can be found in the sila directory of this SDK. These SiLA 2 drivers are based on the CETONI SDK for Python in order to control the devices.

The following types of devices are currently supported by the CETONI SiLA2 drivers:

 CETONI Nemesys Syringe Pumps CETONI Nemesys Tubing Pumps CETONI Stirring Systems CETONI Valves CETONI Reaction Modules CETONI I/O Modules CETONI Sample Handlers CETONI Positioning Systems Sartorius Balances

# Installation

Note
These SiLA 2 drivers were developed and tested under Windows and Linux (Ubuntu 19.04 and Raspbian Buster on a Raspi 3B+) and are therefore expected to work on these systems. Other operating system should work as well, but have not been tested yet!

## Installing CETONI SDK

You'll of course need the CETONI SDK with the Python Integration.

For instructions on how to install the CETONI SDK for Python on your system and get a valid device configuration for your devices see the CETONI SDK Documentation. On Linux be sure to also install the correct SocketCAN driver (either SysTec or IXXAT depending on your CETONI base module).

## Installing sila_cetoni

Install the sila_cetoni package on Windows with

1 > cd path\to\CETONI_SDK\lib\sila
2 > pip install .

or on Linux with

1 $cd path/to/CETONI_SDK/sila 2$ pip install .

It is recommended to use a virtual environment to not interfere with anything in your system's environment. This will install all Python dependencies for sila_cetoni most notably sila_python as well as sila_cetoni itself. This means you can not only use the provided console script to run your CETONI device configurations but also build upon the SiLA 2 implementations and build you own applications.

## Testing Demo Configuration

To quickly test if the installation works properly, you can run the sila-cetoni script with the provided demo configuration with simulated devices. The demo configuration is located in path\to\CETONI_SDK\config\testconfig_qmixsdk. On Windows you can run the demo with the following command:

1 > sila-cetoni -c "..\..\config\testconfig_qmixsdk"

# Running SiLA 2 servers

Note
If your system contains any CETONI devices you always need a valid device configuration created with the CETONI Elements software in order to use SiLA driver. Read the Getting Started section of the CETONI SDK documentation to learn how to create a device configuration. If you only want to control a Sartorius balance, for example, you don't need a device configuration.

Running the corresponding SiLA 2 servers for your system is always done through the sila-cetoni console script that gets installed by pip.

Simply run the script giving it the path to the CETONI device configuration folder as an argument (if necessary):

1 $sila-cetoni -c <path/to/your/device_config> To se a list of all available command line options run 1$ sil-cetoni --help
Note
If you have problems running the sila-cetoni console script try running the application via the module syntax:
1 \$ python -m sila_cetoni.application <arguments...>

Also, in case you get the error ModuleNotFoundError: No module named 'qmixsdk' you have to point the script to the correct location of the CETONI SDK. This can easily be done by setting the CETONI_SDK_PATH environment variable before calling sila-cetoni.

You can play around with the servers and their features by using the freely available SiLA Browser or you can write your own SiLA Client software using the Python or any other of the reference implementations of SiLA 2. If you use the CETONI Elements software, then you can control and automate all your SiLA devices easily using the CETONI Elements SiLA Add-on.

# Troubleshooting

## 'undefined symbol: __atomic_exchange_8' on Raspberry Pi

You might get the following error when trying to run the driver on a Raspberry Pi:

1 Traceback (most recent call last):
2  File "/home/pi/sila_cetoni/sila_cetoni.py", line 43, in <module>
3  from application.application import Application, DEFAULT_BASE_PORT
4  File "/home/pi/sila_cetoni/application/application.py", line 35, in <module>
5  from sila2lib.sila_server import SiLA2Server
6  File "/home/pi/sila_python/sila_library/sila2lib/sila_server.py", line 36, in <module>
7  import grpc
8  File "/home/pi/.local/lib/python3.9/site-packages/grpc/__init__.py", line 22, in <module>
9  from grpc import _compression
10  File "/home/pi/.local/lib/python3.9/site-packages/grpc/_compression.py", line 15, in <module>
11  from grpc._cython import cygrpc
12 ImportError: /home/pi/.local/lib/python3.9/site-packages/grpc/_cython/cygrpc.cpython-39-arm-linux-gnueabihf.so: undefined symbol: __atomic_exchange_8

This is a known bug in gRPC (https://github.com/grpc/grpc/issues/20400) and there exists a workaround, too (https://github.com/opencv/opencv/issues/15278#issuecomment-520893950): You just need to modify sila_cetoni/application/__init__.py like this:

1 # ...
2 env["PATH"] = f"{CETONI_SDK_PATH}:{env['PATH']}"
3 env["PYTHONPATH"] = f"{CETONI_SDK_PATH}/python:{env.get('PYTHONPATH', '')}"
4 env["LD_LIBRARY_PATH"] = f"{CETONI_SDK_PATH}/lib:{env.get('LD_LIBRARY_PATH', '')}"
You are, of course, free to play around with the code inside this repository. The implementation files have been generated using the sila-codegen script that comes with sila_python.
This repository uses a separate python package for each Feature Category, e.g. all SiLA Features of the 'de.cetoni/pumps.syringepumps' category are implemented in the sila_cetoni.pumps.syringepumps package.