6.1.2. Working with controller in Python¶
6.1.2.1. Python (Jupyter Notebook)¶
We’ve made programming easier than ever! No need to set up complex environments or write code from scratch — just open our ready-to-use Jupyter Notebook and start controlling 8SMC5 controllers with Python!
Try now:
Open in Colab
Open in HTML format
Why is this awesome?
- Quick Start - Open the notebook, follow the instructions, and run the code instantly!
- Minimal Setup - No complicated installations, everything is ready to go
- New libximc highlevel API - Control motors with just a few lines of code and skip the low-level complexities
- Easy Motor Control - Step-by-step examples make it simple, even for beginners
- Perfect for Newcomers - If you’re new to Python or motor controllers, this is the best place to start
What’s inside?
- Pre-written code examples for controlling the 8SMC5
- Clear explanations of each step so you understand how it works
- Full support for libximc Python for seamless controller interaction
New to Jupyter Notebook? Check out the official documentation, but don’t worry, you’ll pick it up in minutes!
Note
By default this notebook uses virtual controller. So you don’t need any real hardware. But if you have one, you can also test it with this notebook.
6.1.2.2. Python¶
6.1.2.2.1. General information¶
The Python interface for 8SMC5 controller series is based on the libximc library.
Two usage models for Python bindings are supported:
- Installation via pip
- SDK-based usage without installing the package (legacy approach)
Both interfaces remain available. However, for new projects it is recommended to use the high-level API as it is more convenient and less sensitive to implementation changes.
6.1.2.2.2. Installation via pip¶
Recommended way to install Python bindings:
pip install libximc
This method installs the Python wrappers of the library and allows using them without manually placing files next to user scripts.
It also does not require additional configuration of system environment variables (PATH, LD_LIBRARY_PATH, etc.).
6.1.2.2.3. SDK-based usage (without pip)¶
An alternative approach is based on using the SDK without installing the Python package. In this case:
Python wrappers and examples are taken directly from the SDK
library files must be accessible to the Python interpreter:
- either located in the same directory as user scripts
- or a path to them must be added
This approach allows running SDK examples “as is” and using the library without pip installation.
6.1.2.2.4. Profiles¶
A profile is a configuration file that contains a set of parameters for controller operation and its connected positioner.
The profile is loaded into the controller and defines its behavior, eliminating the need to manually set parameters in every script.
Using profiles allows you to:
- store and reuse controller settings
- quickly switch between different positioners
- work with multiple positioners on a single controller without manually reconfiguring parameters
For standard STANDA positioners, ready-to-use profiles are available and can be used directly.
You may see how to use Python-profiles in “examples/test_Python/profiletest” example directory.