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

Download examples from the Software page.

Change current directory to the examples/test_Python/.

On Linux: you may need to set LD_LIBRARY_PATH so Python can locate libraries with RPATH. For example, you may need:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`

On Windows and MacOS nothing needs to be done before the start.
For example launch example testpython.py: python3 testpython.py

Note

Python-profiles are files distributed with the libximc library. They enable one to set all controller settings for any of the supported stages with a single function call in a python program. You may see how to use Python-profiles in “profiletest” example directory.