Is it possible to command the EPOS4 (or EPOS2) by Python?
maxon does not provide documentation, specific libraries, sample code, or support to command the EPOS controllers by Python. Anyway it is possible to use the "Epos Command library" by Python script to command an EPOS4 (resp. EPOS2).
The following information was provided by a Python user for free usage by 3rd parties.
The only thing which needed is to command the EPOS4 (or EPOS2) by Python is the package "pythonnet" (clr) and the EPOS .NET libraries. The former should be located in your working directory.
Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET developers. It allows Python code to interact with the CLR, and may also be used to embed Python into a .NET application.
The required "pythonnet" library package can be downloaded here:
- The installation package (-> *.whl Wheel file type) should be copied into a local drive and directly installed afterwards using "pip install pythonnet" [hit tab to autocomplete] ...
- Additional information on installation, FAQ, troubleshooting, debugging, and projects using "pythonnet" can be found here:
2.) EPOS Command library for .NET
If you have "EPOS Studio" installed which is required for initial commissioning and tuning anyway, the required EposCmd.Net.dll and EposCmd64.dll is located in the following directory of your local drive by default:
- C:\Program Files (x86)\maxon motor ag\EPOS Positioning Controller\EPOS4\04 Programming\Windows DLL\Microsoft Visual C Sharp\Example C#
It is also possible to download the "EPOS .Net Library" package by the "Software/firmware" section of the "Downloads" tab of each maxon EPOS product site. It is always the same library and documentation independent what EPOS2 or EPOS4 product type is chosen, e.g. "EPOS4 50/5":
The EPOS Command library documentation holding the description of each function and its parameters can be found here:
- C:\Program Files (x86)\maxon motor ag\EPOS Positioning Controller\EPOS4\04 Programming\Windows DLL\Microsoft Visual C Sharp\Documentation
- C:\Program Files (x86)\maxon motor ag\EPOS Positioning Controller\EPOS4\04 Programming\Windows DLL
-> "EPOS Command Library.pdf"
3.) Python sample script
Please find a sample script attached for commanding the EPOS4 by Python. This script has been tested in Spyder / Anaconda with Python 3.7.3.
Please note that maxon cannot provide support or training for Python, pythonnet, or any application specific adaptation of this script. Anyway we are pleased about your feedback if this information was helpful and you managed to command the EPOS4 by Python.